Skip to content

Commit dc3e462

Browse files
committed
LocalProtocolError raised in start_next_cycle shows states
This makes the error much more informative, allowing the reason for it to be more readily deduced.
1 parent 741dc48 commit dc3e462

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

h11/_state.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,9 @@ def _fire_state_triggered_transitions(self):
307307

308308
def start_next_cycle(self):
309309
if self.states != {CLIENT: DONE, SERVER: DONE}:
310-
raise LocalProtocolError("not in a reusable state")
310+
raise LocalProtocolError(
311+
"not in a reusable state. self.states={}".format(self.states)
312+
)
311313
# Can't reach DONE/DONE with any of these active, but still, let's be
312314
# sure.
313315
assert self.keep_alive

0 commit comments

Comments
 (0)