diff --git a/tangostationcontrol/tangostationcontrol/devices/device_decorators.py b/tangostationcontrol/tangostationcontrol/devices/device_decorators.py index bf6340fc55edeec0d0c44da7cc139aeb297f2176..b54b783090e33812b525b77bf2e015a97019b770 100644 --- a/tangostationcontrol/tangostationcontrol/devices/device_decorators.py +++ b/tangostationcontrol/tangostationcontrol/devices/device_decorators.py @@ -21,7 +21,7 @@ def only_in_states(allowed_states, log=True): if log: 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