fix: Fixed wrong naming for error handler middleware

This commit is contained in:
Hüseyin Berke Bütün
2022-12-24 21:45:53 +01:00
parent 6216f70950
commit 22d6aa8e46
2 changed files with 4 additions and 3 deletions
@@ -6,7 +6,7 @@ import { getLogger } from "../utils/logger";
import RequestError, { LogLevel } from "../utils/requestError";
export const catchUnroutedRequests: ErrorRequestHandler = (error: RequestError|Error, req, res, next) => {
export const requestErrorHandler: ErrorRequestHandler = (error: RequestError|Error, req, res, next) => {
if(res.headersSent) return next();
//TODO: Find better way to type check for error. In current setting you need to cast type to get the functions and variables from RequestError
if(!(error instanceof RequestError)){