- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.7k
Open
Labels
A-errorArea: error handlingArea: error handlingB-rfcBlocked: More comments would be useful in determine next steps.Blocked: More comments would be useful in determine next steps.
Description
The Error type in hyper is currently an enum, wrapping up the various cases of things that could go wrong when parsing incoming HTTP data. Some of the problems with the current design:
- Being an enummeans that adding variants is a breaking change. There is a__Nonexhaustivevariant to try to warn that exhaustive matches can cause breaking changes, but that it's better when internals are hidden.
- Users sometimes try to create hyper::Errors, even though they really shouldn't. It is meant only for saying "this thing went wrong while hyper was parsing HTTP", and nothing else. Part of this can be fixed also by changing the actual error types used, such as in outgoingStreams.
Instead, I'd like to propose making the Error an opaque struct, with some methods to inspect the type and details of an error, somewhat along the lines of std::io::Error.
(Still thinking through the specific code, will add a design section later).
Metadata
Metadata
Assignees
Labels
A-errorArea: error handlingArea: error handlingB-rfcBlocked: More comments would be useful in determine next steps.Blocked: More comments would be useful in determine next steps.