hyperium / hyperium/hyper

Consider converting `h2` errors to hyper's error kinds

Open
#2,564 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
16.3k
Forks
1.8k
Avg merge
1d 22h
Merged PRs (30d)
14

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how Hyper wraps h2 errors as error::Kind::Http2 and reviewing the h2 UserError information currently exposed. Define which analogous errors should map to Hyper kinds, including header-too-large to Kind::Parse(Parse::TooLarge), and determine the h2 changes needed to support that mapping.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.