Closed alanbchristie closed 5 years ago
That would make that error message more informative, wouldn't it!
Any interest in putting together a PR? The code that raises that exception is at the bottom of h11/_state.py.
Can do - but my 'day job' gets in the way during normal hours. Happy to look at this after 6pm tonight.
Changes tested and present in https://github.com/python-hyper/h11/pull/81
I'm experiencing
LocalProtocolError("not in a reusable state")
exceptions when using hypercorn (see https://github.com/pgjones/hypercorn/issues/18).It would be extremely valuable if the current state were logged with the exception that occurs in _state.py's
start_next_cycle(self)
method. Then the user would know what the state is as well as what it is expected to be.