Skip to content

Commit aff6341

Browse files
authored
Log error when AttrR fails to validate value in update (#330)
1 parent 1008960 commit aff6341

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/fastcs/attributes/attr_r.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ async def update(self, value: Any) -> None:
7373
self.log_event("Attribute set", value=repr(value), attribute=self)
7474

7575
_previous_value = self._value
76-
self._value = self._datatype.validate(value)
76+
try:
77+
self._value = self._datatype.validate(value)
78+
except ValueError:
79+
logger.error("Failed to validate value", value=repr(value), attribute=self)
80+
raise
7781

7882
self.log_event("Value validated", value=repr(self._value), attribute=self)
7983

0 commit comments

Comments
 (0)