Skip to content

Commit

Permalink
refactor: use enum type name in InvalidStateError
Browse files Browse the repository at this point in the history
InvalidStateError is shared between client and server, so of course
it doesn't make much sense to hardcode "Client state" in the message
  • Loading branch information
thegamecracks committed Mar 24, 2024
1 parent 641ac01 commit 817391f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dumdum/protocol/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class InvalidStateError(ProtocolError):

def __init__(self, current_state: Enum, expected_states: tuple[Enum, ...]) -> None:
super().__init__(
"Client state must be {}, but is currently {}".format(
"{} must be {}, but is currently {}".format(
type(current_state).__name__,
" or ".join(s.name for s in expected_states),
current_state.name,
)
Expand Down

0 comments on commit 817391f

Please sign in to comment.