Skip to content

Commit e6b5cf2

Browse files
committed
changed fallback error code to 500
1 parent ea448b1 commit e6b5cf2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/event-handler/src/rest/Router.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ class Router {
327327
}
328328
}
329329
return new Response(JSON.stringify(body), {
330-
status: (body.statusCode as number) ?? HttpErrorCodes.OK,
330+
status:
331+
(body.statusCode as number) ?? HttpErrorCodes.INTERNAL_SERVER_ERROR,
331332
headers: { 'Content-Type': 'application/json' },
332333
});
333334
} catch (handlerError) {

packages/event-handler/tests/unit/rest/Router/error-handling.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ describe('Class: Router - Error Handling', () => {
446446

447447
// Assess
448448
expect(result).toEqual({
449-
statusCode: HttpErrorCodes.OK,
449+
statusCode: HttpErrorCodes.INTERNAL_SERVER_ERROR,
450450
body: JSON.stringify({
451451
foo: 'bar',
452452
}),

0 commit comments

Comments
 (0)