-
Notifications
You must be signed in to change notification settings - Fork 669
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
Allow exceptions in actions #8000
Comments
+1 |
I agree that there's too much boilerplate around validation, and the idea seems somewhat easy to implement. Only hesitation is that it feels like an abuse of exceptions (goto). |
Fine with me if we stick to specific type of exceptions to be caught and handled as generic messages. We should perhaps differentiate explicitly here between 400 errors and 500, when first ones are caused by bad input data and the latter are server side issues (DB unreachable etc.) |
@mrclay Classes already throw exceptions that unless are caught in the action result in inconveniences for admins and users, e.g. calling |
@hypeJunction was this fixed somewhere along the line? |
HttpException can be thrown and will result in error response out of action. I don't think we need anything else at the moment |
Perhaps we could considering wrapping
action()
withtry()
and catch exceptions. Users would get generic messages based on exception type, admins would get full exception messages.I realize that I spend too much time checking instances, canEdit(), canWriteToContainer() permissions and inventing smart error messages. Would be helpful to have an easy way out by throwing an exception from one of the classes.
The text was updated successfully, but these errors were encountered: