Skip to content

Comments

transport/http: enhance the DefaultErrorEncoder#414

Merged
peterbourgon merged 3 commits intomasterfrom
enhanced-error-encoder
Dec 18, 2016
Merged

transport/http: enhance the DefaultErrorEncoder#414
peterbourgon merged 3 commits intomasterfrom
enhanced-error-encoder

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