-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Currently, when the h2 crate returns an error, that error is wrapped by Hyper with error::Kind::Http2. However, several of h2s errors have analogous semantics to Hyper's error kinds. For example, h2 will return a "user error: header too big" error when encountering a header that's too large, and this could (potentially) be mapped to Hyper's Kind::Parse(Parse::TooLarge). This would be nice since it would make it possible for users to handle specific error cases the same way regardless of whether they occurred on an HTTP/1 or HTTP/2 connection.
I think implementing this might require changes in h2 as well to expose more information about UserErrors --- currently, the UserError type is private, and h2 only allows determining whether an error is a user error, and formatting it...