h2 icon indicating copy to clipboard operation
h2 copied to clipboard

`Reason::PROTOCOL_ERROR` and `Reason::INTERNAL_ERROR` provide little useful information about the… error.

Open nagisa opened this issue 2 years ago • 1 comments

I received an error that reads like this:

error: failed to convert response body to bytes (in application)
    caused by: error reading a body from connection: protocol error: unexpected internal error encountered (in hyper)
    caused by: protocol error: unexpected internal error encountered (in h2?)

I believe the last part ("protocol error: unexpected internal error encountered") is coming from h2. I'm not sure where it originates and searching the code doesn't have present many instances of INTERNAL_ERROR, either. This error is pretty poor and leaves one hanging, so I feel like we should not have these variants as valid options at all, always opting for a more descriptive reason of some sort.

nagisa avatar Sep 21 '21 18:09 nagisa

True, the messages don't explain much. The error codes themselves are in the HTTP/2 specification, and a remote can send them with optional extra debug info, or with nothing. If they send us nothing else, there's not too much more we can do... Though, there is #556 which will try to improve the messages some. In particular, it will add the extra debug data if received, and it will include in the error message whether it was an error code received from the remote, or an error condition we detected locally in the library.

seanmonstar avatar Sep 21 '21 18:09 seanmonstar