Skip to content

Commit

Permalink
core.py: make _update_state error messages more verbose for easier de…
Browse files Browse the repository at this point in the history
…bugging (#51)
  • Loading branch information
vmeylan authored Jul 26, 2022
1 parent 3389258 commit 8addd77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions radcad/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
def _update_state(initial_state, params, substep, result, substate, signals, state_update_tuple):
state, function = state_update_tuple
if not state in initial_state:
raise KeyError("Invalid state key in partial state update block")
raise KeyError(f"Invalid state key {state} in partial state update block")
state_key, state_value = function(
params, substep, result, substate, signals
)
if not state_key in initial_state:
raise KeyError(
"Invalid state key returned from state update function"
f"Invalid state key {state} returned from state update function"
)
if state == state_key:
return (state_key, state_value)
Expand Down

0 comments on commit 8addd77

Please sign in to comment.