I have this problem when capturing the error:
try:
ack_event = PlatformEvent(
notification_event_id=event['detail']['originalEvent']['id'],
source=event['source'],
event_type=event['detail']['originalEvent']['detail']['eventType'],
region=event['region'],
timestamp=event['time'],
organization_id=self.get_notification_event_organization_id(event['detail']['originalEvent']),
success=event['detail']['success'],
result=event['detail']['result'],
event_json=event,
)
ack_event.save()
self.logger.info(f"Saved Acknowledgement Event: {event}")
return self.create_http_response(True, status_code=200)
except Exception as e:
msg_event = f"Error saving acknowledgement event: {event}"
msg_error = f"Error: {e}"
the message that I capture in the Exception as "e" if in the event that I receive there is a wrong property such as "originalEvent" the exception only captures the string "originalEvent" without detail of what the error is. Would there be a way to capture the error in more detail or what would I be doing wrong in this block? Thank you