Skip to content

Ver/eliza/error context#2174

Merged
hawkw merged 6 commits intoeliza/error-context-2from
ver/eliza/error-context
Jan 23, 2023
Merged

Ver/eliza/error context#2174
hawkw merged 6 commits intoeliza/error-context-2from
ver/eliza/error-context

Conversation

@olix0r
Copy link
Member

@olix0r olix0r commented Jan 21, 2023

AnnotateError is really, really similar to MapErr. This change
merges 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.

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.
@olix0r olix0r requested a review from a team as a code owner January 21, 2023 22:20
@olix0r olix0r changed the base branch from eliza/error-context to eliza/error-context-2 January 21, 2023 22:21
Copy link
Contributor

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 hawkw merged commit 24fe537 into eliza/error-context-2 Jan 23, 2023
@hawkw hawkw deleted the ver/eliza/error-context branch January 23, 2023 21:13
Comment on lines +98 to +99
// We don't actually care about the `()` types here, but they help avoid
// inference problems.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smart!

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.

3 participants