supabase-js icon indicating copy to clipboard operation
supabase-js copied to clipboard

List of error responses for each function

Open paddyjoneill opened this issue 2 years ago • 4 comments

Improve documentation

Describe the problem

It would be useful to have a list of all the error responses for each function so that relevant messages can be displayed to the user based on the error.

Describe the improvement

A list of error codes for each function

paddyjoneill avatar Jan 03 '23 20:01 paddyjoneill

Indeed. As it stands, it really is a pain in the back: I have to dig through the source to find out about errors. I'd be really really helpful if the documentation included error messages alongside their status codes.

imageck avatar Apr 16 '23 18:04 imageck

I ran into the same issue and started collecting possible error messages by going through the GoTrue implementation.

I created a package that offers an error handler method for each function: https://github.com/joeldomke/supabase-errors-js

joeldomke avatar Jul 02 '23 13:07 joeldomke

how does one release a lib without error documentation ?? I need to reverse engineer the different usages in order to know what will be sent in each scenario, horrible.

Roeia1 avatar Nov 02 '23 12:11 Roeia1

I just realized I need to compare a string (!) when I'm receiving a credentials error since the error that is thrown is of class AuthApiError from gotrue-js instead of the AuthInvalidCredentialsError class there. so I need to compare the error message to a string you added somewhere on your code which isn't exported from your package, which means it can change at any moment...

Roeia1 avatar Nov 02 '23 13:11 Roeia1