From 4807c60042b642985a958495fa83255eebea5968 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 25 Sep 2023 08:18:22 -0400 Subject: [PATCH] fix: Do not modify internet server error before pushing to Sentry --- server/onerror.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/onerror.ts b/server/onerror.ts index 0a32e4cc0..a59272419 100644 --- a/server/onerror.ts +++ b/server/onerror.ts @@ -66,12 +66,12 @@ export default function onerror(app: Koa) { err = AuthorizationError(); } - if (typeof err.status !== "number" || !http.STATUS_CODES[err.status]) { - err = InternalError(); - } - - // Push only unknown 500 errors to sentry - if (err.status === 500) { + // Push only unknown and 500 status errors to sentry + if ( + typeof err.status !== "number" || + !http.STATUS_CODES[err.status] || + err.status === 500 + ) { requestErrorHandler(err, this); if (!(err instanceof InternalError)) {