Specify enum key when assigning incorrect value

This makes the exception a bit clearer on which property exactly has the incorrect value
This commit is contained in:
Niek Schoemaker 2024-12-10 20:35:35 +01:00
parent 59e3d9949f
commit cb216eab59
No known key found for this signature in database
GPG key ID: BDF9404CFECB0006

View file

@ -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}")