Skip to content

Commit 2610750

Browse files
committed
🐛 prevent errors with status < 400
1 parent 7e6da2f commit 2610750

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/middlewares/error-handler.middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function errorHandlerMiddleware(
88
// eslint-disable-next-line @typescript-eslint/no-unused-vars
99
next: NextFunction,
1010
): void {
11-
if (error instanceof ServerError) {
11+
if (error instanceof ServerError && error.status >= 400) {
1212
res.status(error.status).send(error.message);
1313
return;
1414
}

0 commit comments

Comments
 (0)