supabase-js
supabase-js copied to clipboard
List of error responses for each function
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
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.
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
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.
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...