postgrest-js
postgrest-js copied to clipboard
`error` is returned as `[]` if `.update()` matched no records
Feature request
Is your feature request related to a problem? Please describe.
This is not a feature, so much as an improvement. I noticed when preforming an update, the response returns an error if the request didn't match any records. This is expected. However the response.error comes back as a empty array, which is not very helpful. A message could make error handling and debugging easier for consumers.
Describe the solution you'd like
A message indicating the request did not match any existing records
Describe alternatives you've considered
I stop whining about missing error messages. After all, the response does return a 404.
Additional context
Thanks! This seems to be a bug. ~~Can you provide the supabase-js version you used?~~ Nvm, was able to reproduce this on the latest version.
Related https://github.com/PostgREST/postgrest/issues/2343
Same issue when .range()
is not satisfiable: #324.
Just to be clear, on this issue there is no error message in the response body coming from the server, only a 4xx status. This needs a fix on the PostgREST side.