@@ -179,3 +179,44 @@ Scenario Outline: unhandled asynchronous exceptions are reported when using hono
179179 And the event "session.events.handled" equals 0
180180 And the event "session.events.unhandled" equals 1
181181
182+ @hono-app
183+ Scenario Outline : thrown non-error exceptions are reported when using hono
184+ Given I setup the environment
185+ When I invoke the "HonoFunction" lambda in "features/fixtures/hono-app" with the "events/throw-non-error.json" event
186+ Then the lambda response "errorMessage" equals "1"
187+ And the lambda response "errorType" equals "number"
188+ And the lambda response "body" is null
189+ And the lambda response "statusCode" is null
190+ And the SAM exit code equals 0
191+ When I wait to receive 2 errors
192+
193+ Then the error is valid for the error reporting API version "4" for the "Bugsnag Node" notifier
194+ And the event "unhandled" is true
195+ And the event "severity" equals "error"
196+ And the event "severityReason.type" equals "unhandledException"
197+ And the exception "errorClass" equals "Error"
198+ And the exception "message" equals "1"
199+ And the exception "type" equals "nodejs"
200+ And the event "metaData.AWS Lambda context.functionName" equals "HonoFunction"
201+ And the event "metaData.AWS Lambda context.awsRequestId" is not null
202+ And the event "device.runtimeVersions.node" matches "^18\.\d +\.\d +$"
203+
204+ # Error thrown by hono
205+ And I discard the oldest error
206+ Then the error is valid for the error reporting API version "4" for the "Bugsnag Node" notifier
207+ And the event "unhandled" is true
208+ And the event "severity" equals "error"
209+ And the event "severityReason.type" equals "unhandledErrorMiddleware"
210+ And the exception "errorClass" equals "InvalidError"
211+ And the exception "message" matches "hono middleware received a non-error\. "
212+ And the exception "type" equals "nodejs"
213+ And the event "metaData.AWS Lambda context.functionName" equals "HonoFunction"
214+ And the event "metaData.AWS Lambda context.awsRequestId" is not null
215+ And the event "device.runtimeVersions.node" matches "^18\.\d +\.\d +$"
216+
217+ When I wait to receive a session
218+ Then the session is valid for the session reporting API version "1" for the "Bugsnag Node" notifier
219+ And the session "id" is not null
220+ And the session "startedAt" is a timestamp
221+ And the event "session.events.handled" equals 0
222+ And the event "session.events.unhandled" equals 1
0 commit comments