feat: Convert error handler ts file to js file

This commit is contained in:
Faruk AYDIN
2023-12-28 13:17:09 +01:00
parent 9b01a2a4da
commit 5fd90355ae

View File

@@ -1,15 +1,7 @@
import { NextFunction, Request, Response } from 'express';
import logger from './logger';
import BaseError from '../errors/base';
// Do not remove `next` argument as the function signature will not fit for an error handler middleware
const errorHandler = (
err: BaseError,
req: Request,
res: Response,
next: NextFunction
): void => {
const errorHandler = (err, req, res, next) => {
if (err.message === 'Not Found') {
res.status(404).end();
} else {