-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make error message consistent across all backends #832
Comments
API operation behaviour across backends includes
5 UPDATE a resource
6 LIST a group of resources
|
Notes for backend owners to refactor the response error:
|
Regarding refactoring the errors in backends: all our backends have 3 layers:
To make the refactor simpler, I suggest we
So the handler layer will be the central place to decide how to return the final user-facing error with "github.com/instill-ai/x/sterr", and we don’t have to refactor the error handling in all three layers all over the place. |
Because - refactor error message https://github.com/instill-ai/vdp/issues/112 This commit - refactor error messages - make email field required - update mgmt-backend port from 8080 to 8084
Why
I suggest we make the error message consistent across all backends, so the frontend can present more constructive error messages to the users.
Now
Right now, our API error returns all error messages in the message field.
How to improve
We put a short error description in the message field (generally less than 5 words), and put the long description in details field. Use the above error as an example.
Btw, From Golang docs,
Let's follow the practice in refactoring.
The text was updated successfully, but these errors were encountered: