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

fix(tonic): Expose h2 error instead of reason #883

Merged
merged 1 commit into from Jan 12, 2022

Conversation

roblabla
Copy link
Contributor

@roblabla roblabla commented Jan 4, 2022

Motivation

Currently, when an error occurs at the H2 layer, it is transformed into a tonic::Status with a source() containing only the H2 error reason, instead of the full error. This loses a ton of context, as it is now impossible to know if the failure was caused by a protocol error, a general IO error (and if so, what what IO error), or something else entirely. It makes it much harder to debug problems.

It is unclear why this choice was made in #612. There's talk about Clone implementations causing this to be necessary, but I can't find that implementation.

Solution

This MR simply bubbles up the underlying h2::Error. tonic::Status::source will contain an h2::Error instead of an h2::Reason.

@davidpdrsn
Copy link
Member

iirc Status only contained the h2 error reason, since Status needed to be Clone. However when we removed that requirement in #612 I think we just forgot to store the whole error instead of only the reason.

I think this change makes sense but its probably a breaking change since source downcasts will have to change.

@LucioFranco LucioFranco changed the title Properly bubble up h2 errors in tonic::Status fix(tonic): Expose h2 error instead of reason Jan 12, 2022
@LucioFranco LucioFranco merged commit a33e15a into hyperium:master Jan 12, 2022
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.

None yet

3 participants