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

transport/http: enhance the DefaultErrorEncoder #414

Merged
merged 3 commits into from
Dec 18, 2016

Conversation

peterbourgon
Copy link
Member

  • Errors may implement StatusCoder interface
  • Errors may implement Headerer interface
  • Errors may implement json.Marshaler interface

This provides another mechanism for mapping business-domain errors to transport-domain serialization. It should also help with an upcoming basicauth package.

@peterbourgon peterbourgon force-pushed the enhanced-error-encoder branch 3 times, most recently from 8df4476 to 520cf55 Compare December 14, 2016 18:33
- Errors may implement StatusCoder interface
- Errors may implement Headerer interface
- Errors may implement json.Marshaler interface
This RequestFunc moves many HTTP request parameters to the context under
specific keys. If wired in to the transport, those values are available
to subsequent endpoints or service methods that receive the context.
This can be used to e.g. log transport (HTTP) details in a service
logging middleware.
@peterbourgon peterbourgon force-pushed the enhanced-error-encoder branch from b608fa9 to 8599541 Compare December 18, 2016 14:31
@peterbourgon peterbourgon merged commit 44df43e into master Dec 18, 2016
@peterbourgon peterbourgon deleted the enhanced-error-encoder branch December 18, 2016 14:54
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.

1 participant