fix: Do not modify internet server error before pushing to Sentry

This commit is contained in:
Tom Moor
2023-09-25 08:18:22 -04:00
parent dd02bd9c03
commit 4807c60042

View File

@@ -66,12 +66,12 @@ export default function onerror(app: Koa) {
err = AuthorizationError(); err = AuthorizationError();
} }
if (typeof err.status !== "number" || !http.STATUS_CODES[err.status]) { // Push only unknown and 500 status errors to sentry
err = InternalError(); if (
} typeof err.status !== "number" ||
!http.STATUS_CODES[err.status] ||
// Push only unknown 500 errors to sentry err.status === 500
if (err.status === 500) { ) {
requestErrorHandler(err, this); requestErrorHandler(err, this);
if (!(err instanceof InternalError)) { if (!(err instanceof InternalError)) {