diff --git a/bugsnag/client.py b/bugsnag/client.py index 987ab517..558b074a 100644 --- a/bugsnag/client.py +++ b/bugsnag/client.py @@ -476,7 +476,12 @@ def report_timeout_to_bugsnag(): return real_handler(aws_event, aws_context) except Exception as exception: if self.configuration.auto_notify: - self.notify(exception) + self.notify( + exception, + unhandled=True, + severity='error', + severity_reason={'type': 'unhandledException'}, + ) raise finally: diff --git a/tests/test_client.py b/tests/test_client.py index 285b3ddd..f01b8589 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1843,6 +1843,7 @@ def my_handler(event, context): payload = self.server.events_received[0]['json_body'] event = payload['events'][0] + assert event['unhandled'] assert event['exceptions'][0]['message'] == 'oh dear' assert event['metaData']['AWS Lambda Event'] == {'a': 1} assert event['metaData']['AWS Lambda Context'] == { @@ -1878,6 +1879,7 @@ def my_handler(event, context): payload = self.server.events_received[0]['json_body'] event = payload['events'][0] + assert event['unhandled'] assert event['exceptions'][0]['message'] == 'oh dear' assert event['metaData']['AWS Lambda Event'] == {'z': 9} assert event['metaData']['AWS Lambda Context'] == {