Skip to content
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

Exception and Error Handlers break content type negotiation #109

Open
drakej opened this issue Jun 17, 2014 · 1 comment
Open

Exception and Error Handlers break content type negotiation #109

drakej opened this issue Jun 17, 2014 · 1 comment
Labels
Milestone

Comments

@drakej
Copy link

drakej commented Jun 17, 2014

It would be nice to actually have the Exception and Error Routes be treated the same as all other types or Route objects. Instead what happens is the minute there's an exception, all of the accept() routine functionality is completely ignored and a call is made to these handlers that just spits that content out as is without any regard to the Accept header. This breaks parsers that are expecting valid content responses.

On top of this issue, if you return an empty string to try to at least prevent the parsing issues without giving any detail to the cause, it still breaks. It appears that the Request object is doing lazy comparisons with what was returned from the Exception handler and if it's an empty value, it assumes that the handler failed and then rethrows the exception.

This is basically a deal breaker since my choice is to not handle exceptions and have the API break entirely, or return non valid content results and have the API parsers break on the client side. Both completely unacceptable.

@endel
Copy link

endel commented Jul 25, 2014

+1

It would be useful to display pretty JSON / HTML errors for the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants