mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2025-04-19 15:29:18 +00:00
* BETTERZON-100: Switching session handling to cookies * BETTERZON-100: Some code reformatting * BETTERZON-100: Some more code reformatting
16 lines
437 B
TypeScript
16 lines
437 B
TypeScript
import HttpException from '../common/http-exception';
|
|
import {Request, Response, NextFunction} from 'express';
|
|
|
|
export const errorHandler = (
|
|
error: HttpException,
|
|
request: Request,
|
|
response: Response,
|
|
next: NextFunction
|
|
) => {
|
|
const status = error.statusCode || 500;
|
|
const message =
|
|
error.message || 'It\'s not you. It\'s us. We are having some problems.';
|
|
|
|
response.status(status).send(message);
|
|
};
|