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();
}
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)) {