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
Improve error handling #118
Comments
I've taken care of only enabling whoops in debug mode. I also built error handlers for the frontend and the API. The frontend error pages are rather plain - I'll let you work your design magic on them, @tobscure. Maybe you're also more creative than me in making them unique and fun. One thing I'm not sure about right now is the following: for some errors like validation errors etc., we probably do not want to show Whoops, even when in debug mode, right? (I guess it depends on how AJAX errors are handled exactly in the frontend.) Any good idea how we could take care of those cases? |
Currently if the front-end doesn't receive JSON, it basically crashes the JS app. I will wrap the JSON parsing code with a try/catch so that it doesn't, and instead show a little red alert in the bottom left. So I think in debug mode any abnormal exception can trigger whoops and then you can use the browser inspector to see the error details. But you're completely right about not wanting some errors (validation in particular) to be handled with whoops. We actually already have code in JsonApiAction@handle to catch some of those and output JSON-API spec errors. I think this could all be moved into a new error handler middleware. And if debug is not enabled, this needs to catch all exceptions and output a generic JSON-API spec error too. Edit: the latter of which I see you've done! Nice! |
See #252 re: error pages |
What needs to be done:
|
@franzliedke yep. |
The default XHR error handler produce an alert which is appropriate to the response status code. It can be overridden per-request (by specifying the `errorHandler` option) so that the alert can be suppressed or displayed in a different position (e.g. inside a modal). ref #118
Closing this for beta 3. The rest is design stuff (polish) which isn't as high priority: #596 |
What about these three issues that were merged into this one?
At least the third one doesn't look like it's already fixed... |
True, will take a look at them tomorrow. |
Forum backend
API
Forum frontend
The text was updated successfully, but these errors were encountered: