Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

Handle errors better #17

Open
2 tasks
Lukasa opened this issue Feb 16, 2014 · 5 comments
Open
2 tasks

Handle errors better #17

Lukasa opened this issue Feb 16, 2014 · 5 comments

Comments

@Lukasa
Copy link
Member

Lukasa commented Feb 16, 2014

Right now if hyper hits an error it just throws exceptions. This leaves the connection in an undefined state, and is fundamentally unusable from then on. We should start handling this better. 'Better' means two things:

  • Errors on a single stream should cause us to send RST_STREAM frames. Exceptions should still be thrown, but the connection should be OK.
  • Errors that affect the whole connection should cause us to send GOAWAY with an appropriate error code, and then tear the connection down.
@Lukasa
Copy link
Member Author

Lukasa commented Feb 16, 2014

The likely best way to handle this is to wrap affected methods in decorators that catch exceptions. We should provide our own set of exceptions that can carry appropriate HTTP/2.0 failure codes on them. Given such an exception, we can use the appropriate frame and code. Unexpected exceptions will get a generic error code.

@fredthomsen
Copy link
Contributor

Would it be appropriate/preferred to define each error in RFC7540 with a corresponding exception?

@Lukasa
Copy link
Member Author

Lukasa commented Dec 26, 2015

@fredthomsen Nope, I don't think so. This model is better, I think.

@fredthomsen
Copy link
Contributor

Ok. I'll take a crack at this. I'll start a pull request once I have something.

@fredthomsen
Copy link
Contributor

#188

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants