Skip to content

Commit

Permalink
Add descriptive error message to assert
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikmakait committed Aug 11, 2022
1 parent cb45c61 commit 7734557
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion distributed/worker_state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1918,7 +1918,10 @@ def _transition_cancelled_error(
*,
stimulus_id: str,
) -> RecsInstrs:
assert ts.previous in ("executing", "long-running")
assert ts.previous in (
"executing",
"long-running",
), f"Expected 'executing' or 'long-running'; got '{ts.previous}'"
recs, instructions = self._transition_executing_error(
ts,
exception,
Expand Down

0 comments on commit 7734557

Please sign in to comment.