-
Notifications
You must be signed in to change notification settings - Fork 38
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
Backend business rules exceptions are not handled well in front end #108
Comments
See if these are showing in the exception catcher. |
Currently, the back-end throws a 500 error invalid business rule. Instead, it should return a 400 error with a payload object that specifies the offending field if applicable. The payload object should have an error code, which is then resolved to an error message by the front-end for purposes of localization. |
For pick lists, I propose maintaining the uniqueness constraint, however it should mitigate the error (which loses all progress) by appending a (2) or (3) after the name (or at least prompt the user to enter a new name). |
Looks like @benanhalt began this in 8f92c91 Still need to modify the response code to return a 4xx instead of 5xx, as 5xx would return an HTML response instead of JSON if the back-end is running in debug mode |
Inventory the exceptions. |
I was thinking Front-End would just catch the error and display it next to the field that triggered the issue. Thus, in the short term, front-end won't be preventing any errors, but it would display them nicely (with localized context aware error messages) |
@benanhalt does this sound good to you? |
I think that is the basic idea, but it will be somewhat more involved. For instance I think there are instances where the exception can't be traced to one particular field. |
In such cases a dialog message would be displayed. The front-end already does it for save blockers: |
@benanhalt Another reason to modify the response code: I feel like this is a really terrible situation and should be fixed soon. |
Fixed in #2702 |
This issue has been mentioned on Specify Community Forum. There might be relevant details there: https://discourse.specifysoftware.org/t/specify-7-8-4-announcement/999/1 |
No description provided.
The text was updated successfully, but these errors were encountered: