aboutsummaryrefslogtreecommitdiff
path: root/src/middlewares.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/middlewares.ts')
-rw-r--r--src/middlewares.ts4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/middlewares.ts b/src/middlewares.ts
index 249ff67..dc98a6c 100644
--- a/src/middlewares.ts
+++ b/src/middlewares.ts
@@ -1,7 +1,5 @@
import { NextFunction, Request, Response } from 'express';
-import ErrorResponse from './interfaces/ErrorResponse';
-
export function notFound(req: Request, res: Response, next: NextFunction) {
res.status(404);
const error = new Error(`🔍 - Not Found - ${req.originalUrl}`);
@@ -9,7 +7,7 @@ export function notFound(req: Request, res: Response, next: NextFunction) {
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
-export function errorHandler(err: Error, req: Request, res: Response<ErrorResponse>, next: NextFunction) {
+export function errorHandler(err: Error, req: Request, res: Response<{message: string, stack?: string | any[]}>, next: NextFunction) {
const statusCode = res.statusCode !== 200 ? res.statusCode : 500;
res.status(statusCode);
res.json({