-
Notifications
You must be signed in to change notification settings - Fork 286
Not standardized response on error #4
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
Comments
Hi Ramon! Thanks, I just fixed it in release v.1.2.5. Again if you find anything else or have any ideas to improve, just let me know. Cheers! |
Thanks Daniel! Works great with my frontend now! |
Hi Ramon, well using uppercase and dashes for responses allows you to set a constant and then your message for i18n, I think it´s more readable that way so people understands easier, if changing to numbers works for you it´s great! But for learning purposes I think it´s better as it is now. Also the role is returning now when getting/patching profile in v.1.2.6. |
Hi Daniel! sorry I haven't explained myself well! I meant that I changed some responses to uppercase and dashes to unify all the responses as uppercase and dashes. When I arrive to the office later I'll send you the responses I changed. |
When fetching data from the backend you got a response object. When there are errors the object is called 'errors' and if the errors are from validation, you get an array with the location, param, value and msg.
The problem is with POST /register, when you send an incorrect email like "asdasd@asdas" you don't get the validation error object, just a plain error object:
Instead of:
On the other hand, if you send an invalid email in POST /login you get the right validation error.
It's possible to standardize all errors to just get WHATEVER_WHATEVER (like IS_EMPTY)?
The text was updated successfully, but these errors were encountered: