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

Add request in error handlers #88

Merged
merged 1 commit into from
Jan 13, 2016

Conversation

daniellowtw
Copy link

We have a use case where we want to customise the error handler, for example, adding html templates and sending back the error depending on whether the client allows html or not. The library currently allows us to override the HTTPError caused by the grpc request but the not errors caused by the server muxer. Furthermore, the incoming client request is not propagated to HTTPError so it is not possible to figure out the Accept header of the request.

This PR adds these two functionalities: a OtherErrorHandler variable which can be overridden like HTTPError, and forwarding the incoming request to the error handlers so they can have more flexibility in determining how to handle the errors.

@yugui
Copy link
Member

yugui commented Jan 12, 2016

LGTM

yugui added a commit that referenced this pull request Jan 13, 2016
@yugui yugui merged commit 86c2fc2 into grpc-ecosystem:master Jan 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants