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

feat(error): preserve InvalidUri details #3044

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Commits on Nov 4, 2022

  1. feat(error): preserve InvalidUri details

    This branch changes the representation of the `Parse::Uri` error kind to
    preserve information provided by the `http` crate's `uri::InvalidUri`
    and `uri::InvalidUriParts` errors. A new `InvalidUri` enum is added that
    holds one of those two error types, or a custom message (since `hyper`
    currently returns `Parse::Uri` errors that didn't come from an inner
    `http` error in some cases). The new enum has a custom `Display` and
    `Debug` implementation to reduce repetition of the string "invalid URI"
    in its formatted output.
    
    This is _not_ stored as the error's `cause` currently in order to avoid
    exposing the `http` crate's error types in the public API. However, when
    `http` 1.0 is released, we can simplify this code significantly by
    storing the error as a cause and exposing it in the source chain.
    
    Closes #3043
    hawkw committed Nov 4, 2022
    Configuration menu
    Copy the full SHA
    c3e4bb3 View commit details
    Browse the repository at this point in the history