10 lines
314 B
TypeScript
10 lines
314 B
TypeScript
|
import { Request, Response } from "express";
|
||
|
import { ExceptionBase } from "../exceptions/exceptionsBaseType";
|
||
|
|
||
|
export default function errorHandler(err: ExceptionBase, req: Request, res: Response, next: Function) {
|
||
|
let status = err.statusCode ?? 500;
|
||
|
let msg = err.message;
|
||
|
|
||
|
res.status(status).send(msg);
|
||
|
}
|