From 984678a847ca79c88dedd1d714e96a3e3ad6cfb4 Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Mon, 20 Dec 2021 16:41:20 +0100 Subject: [PATCH] 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 --- .../tangostationcontrol/devices/device_decorators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tangostationcontrol/tangostationcontrol/devices/device_decorators.py b/tangostationcontrol/tangostationcontrol/devices/device_decorators.py index bf6340fc5..b54b78309 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 -- GitLab