3
Send error codes for errors
Source: supabase/supabase#21479 · opened by @Jonny1987
Chore
Give each error an error code
Describe the chore
Currently many errors have the same status code (eg 400) and the only information about the error is the message. This means that in my code, I need to write a condition for this error message if I want to check for it, but this means if the error message changes then my code will no longer work.
For example, the supabase.auth.signInWithPassword() function in flutter raises error with the message "Email not confirmed" or "Invalid login credentials" in the corresponding situations. But the status code for both is 400 so I can only check for this message exactly as written.
It would be better if the response also sent an error code so that the condition could be made on this, without risking any problems if the error message gets changed in the future.
Additional context
Add any other context or screenshots that help clarify the task.
Give each error an error code
Describe the chore
Currently many errors have the same status code (eg 400) and the only information about the error is the message. This means that in my code, I need to write a condition for this error message if I want to check for it, but this means if the error message changes then my code will no longer work.
For example, the supabase.auth.signInWithPassword() function in flutter raises error with the message "Email not confirmed" or "Invalid login credentials" in the corresponding situations. But the status code for both is 400 so I can only check for this message exactly as written.
It would be better if the response also sent an error code so that the condition could be made on this, without risking any problems if the error message gets changed in the future.
Additional context
Add any other context or screenshots that help clarify the task.
No pledges yet. Be the first to back this.
Comments
Similar requests
Standardize Error Codes Across Supabase Ecosystem
1 vote · 0 comments
Export Error Codes
4 votes · 0 comments
Make `error` codes non-optional for better error handling on the client side
4 votes · 0 comments
Document all possible errors for each endpoint
2 votes · 0 comments
Return rejected Promise<Error> for API errors
1 vote · 0 comments
No comments yet.