Merged
Conversation
Signed-off-by: Oliver Gould <ver@buoyant.io>
`AnnotateError` is really, really similar to `MapErr`. This change merges the implementations and cleans up some of the caller type boilerplate.
hawkw
approved these changes
Jan 23, 2023
Contributor
hawkw
left a comment
There was a problem hiding this comment.
overall, this looks good --- i think unifying AnnotateError and MapErr makes sense. i left a few minor nits and suggestions, but this seems good to me overall.
Comment on lines
-329
to
-333
| let protocol = match protocol { | ||
| Some(http::Version::Http1) => "HTTP/1", | ||
| Some(http::Version::H2) => "HTTP/2", | ||
| None => "opaque", | ||
| }; |
Contributor
There was a problem hiding this comment.
the reason that I included protocols here is because the EndpointError may be handled by a ClientRescue layer without being wrapped in other stacks' higher-level error contexts, so i thought it was desirable to include that information here. i'm fine with removing it for simplicity's sake, though.
Member
Author
There was a problem hiding this comment.
ooooh. hmm. okay. I need to refresh on that. In any case, the target types are going to change, so we can keep it simple for now and then polish as it settles.
Co-authored-by: Eliza Weisman <eliza@buoyant.io>
hawkw
reviewed
Jan 23, 2023
hawkw
reviewed
Jan 23, 2023
Comment on lines
+98
to
+99
| // We don't actually care about the `()` types here, but they help avoid | ||
| // inference problems. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AnnotateErroris really, really similar toMapErr. This changemerges the implementations and cleans up some of the caller type
boilerplate.
This also includes some changes to error formatting.
I've removed the http version param constraints from Endpoint -- we should have that information elsewhere on the stack.