From cb216eab595d97fbc296c4617af71d2f68dcc6a1 Mon Sep 17 00:00:00 2001 From: Niek Schoemaker <32094562+niekschoemaker@users.noreply.github.com> Date: Tue, 10 Dec 2024 20:35:35 +0100 Subject: [PATCH] Specify enum key when assigning incorrect value This makes the exception a bit clearer on which property exactly has the incorrect value --- pyhon/parameter/enum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyhon/parameter/enum.py b/pyhon/parameter/enum.py index 2d49b7c..3e17aa7 100644 --- a/pyhon/parameter/enum.py +++ b/pyhon/parameter/enum.py @@ -48,4 +48,4 @@ class HonParameterEnum(HonParameter): self._value = value self.check_trigger(value) else: - raise ValueError(f"Allowed values: {self._values} But was: {value}") + raise ValueError(f"Allowed values for {self.key}: {self._values} But was: {value}")