Skip to content
Snippets Groups Projects
Commit 984678a8 authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-549: Just throw Python exceptions, not directly Tango ones. Keeps the...

L2SS-549: Just throw Python exceptions, not directly Tango ones. Keeps the code more uniform, and avoids having to use the more cumbersome PyTango interface
parent 57abb0dc
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ def only_in_states(allowed_states, log=True): ...@@ -21,7 +21,7 @@ def only_in_states(allowed_states, log=True):
if log: if log:
logger.warning(f"Illegal command: Function {func.__name__} can only be called in states {allowed_states}. Current state: {self.get_state()}") logger.warning(f"Illegal command: Function {func.__name__} can only be called in states {allowed_states}. Current state: {self.get_state()}")
Except.throw_exception(f"IllegalCommand: Function {func.__name__} can only be called in states {allowed_states}. Current state: {self.get_state()}") raise Exception(f"IllegalCommand: Function {func.__name__} can only be called in states {allowed_states}. Current state: {self.get_state()}")
return state_check_wrapper return state_check_wrapper
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment