Common: Don't hide AttributeError from the caller

This commit is contained in:
Mike Salvatore 2022-09-13 07:55:15 -04:00
parent 780595cf19
commit 6c0b63aa29
1 changed files with 1 additions and 6 deletions

View File

@ -18,12 +18,7 @@ class PydanticEventSerializer(IEventSerializer, Generic[T]):
if not issubclass(event.__class__, self._event_class):
raise TypeError(f"Event object must be of type: {self._event_class.__name__}")
try:
return event.dict(simplify=True)
except AttributeError as err:
logger.error(f"Error occured while serializing an event {event}: {err}")
return None
return event.dict(simplify=True)
def deserialize(self, serialized_event: JSONSerializable) -> T:
return self._event_class(**serialized_event)