Skip to content

Consider converting h2 errors to hyper's error kinds  #2564

@hawkw

Description

@hawkw

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions