-
Notifications
You must be signed in to change notification settings - Fork 436
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
Ignore a Controller or specific endpoint? #472
Comments
@dhempy it does seem useful to provide a list of exception classes that should not be caught by Better Errors. Something like I suppose it also could be possible to do the same thing with path matching, but I think exception classnames would be more broadly useful. |
I have the same requirement. I would like to disable better_errors for all requests to our API controllers, but have better_errors work for non-API controllers. In development I still want the API controller to return the same error response it would in production so I can do development on the error handling of API clients. |
@k1w1 Better Errors will only change the response for an unhandled exception. If you want development to act the same as production, it would be best to add a Now that I've read your comment, I realize this might be the answer that @dhempy might be looking for. |
Thanks, that makes perfect sense now. I just need to |
I'd like for better_errors to not do anything for a given endpoint or controller.
For example, I have
UptimeController#example_error
that intentionally raises an error to aid in system monitoring. This works fine in prod, but in dev better_errors does its job and returns a better error message.But I don't want it to. I want to actually see the error returned to the browser, as it will in prod.
I've tried:
BetterErrors.ignored_classes = ['ActionDispatch::Request', 'ActionDispatch::Response', 'UptimeController']
...but I guess that only affects inspection, not rescuing.
Is it currently possible to suppress better_errors for one endpoint?
If not, would this be useful to others? I don't mind taking it on, if the community doesn't think it's a dumb idea.
The text was updated successfully, but these errors were encountered: