-
-
Notifications
You must be signed in to change notification settings - Fork 835
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
Refactor exception handling, rendering, and reporting #1641
Comments
One thing I think is a must-have is the ability to easily enable Sentry. This would especially be helpful for taking immediate action when encountering unexpected errors on discuss. I will gladly provide an extension if need be. |
I'd be most interested in your opinion on this:
|
Catching NotFound exceptions allows for customising the returned response, eg with a decent error page or through extensions to list related discussions. Unless of course an extension could be configured to handle an uncaught exception (add to the handler stack, I think this is currently the case). I would be very interested to know whether we can create decent error pages for any HttpException (with 500 probably being the 'exception'). |
@luceos Yes, I want to keep that part. My question was about the Whoops error page, which is currently shown (in debug mode) for NotFound exceptions and the like. IMO, these exceptions should always be handled by the error handler stack. Debug mode (a.k.a. Whoops error pages) would then only have an effect for generic 500 errors. |
When in debug mode you should always be able to get as much information as possible immediately (without diving into logs). I can imagine it would be easier to identify the cause of an incorrect 404 with whoops enabled for those kind of exceptions. Such exceptions can not only be caused by a |
If Whoops was kept for non-500 errors, which I agree with @luceos in that it would help debug, IMO it should still return the error code as the HTTP status. |
That is a great suggestion and would alleviate most of my concerns. |
Now that #1648 is merged, what's left here is a rethink of how logging, exception handling and exception rendering fit together. This also raises the question of how the new CSRF token mismatch handling fits in - generating the same status code from different exceptions is now possible, which means that we probably want to vary the returned pretty view based on the exception type, not the status code. |
...instead of status code. There are (or will be) multiple different keys for similar errors with the same status code. In the future, we will use the error's "type" (see flarum/framework#1843) to distinguish them. Refs flarum/framework#1641.
It has the same effect as the PermissionDeniedException, so let's just use that. Refs #1641.
...not based on status code. To simplify this logic, we now use the same error "type" both when routes are not found and specific models are not found. One exception is ours, one is from Laravel, but for the purposes of error handling they should be treated the same. Fixes #1641.
It has the same effect as the PermissionDeniedException, so let's just use that. Refs #1641.
...not based on status code. To simplify this logic, we now use the same error "type" both when routes are not found and specific models are not found. One exception is ours, one is from Laravel, but for the purposes of error handling they should be treated the same. Fixes flarum#1641.
It has the same effect as the PermissionDeniedException, so let's just use that. Refs flarum#1641.
...instead of status code. There are (or will be) multiple different keys for similar errors with the same status code. In the future, we will use the error's "type" (see flarum/framework#1843) to distinguish them. Refs flarum/framework#1641.
...instead of status code. There are (or will be) multiple different keys for similar errors with the same status code. In the future, we will use the error's "type" (see flarum/framework#1843) to distinguish them. Refs flarum/framework#1641.
From #1633 (review):
May be worth taking some inspiration from https://laravel.com/docs/5.7/errors
I would also like to see the ability to configure logging - we may as well make use of the power of Laravel's logging component.
Step-by-step TODO:
The text was updated successfully, but these errors were encountered: