1234567891011121314 |
- import { Middleware, StatusCodes } from '../base/http';
- import { NextFunction, Request, Response } from 'express';
- import { $$ } from '../base/i18n';
- class InternalServerErrorHandler extends Middleware {
- protected order = 10000;
- protected route = null;
- protected action = (err: Error, req: Request, res: Response, next: NextFunction): any => {
- this.context.logError(`${err.message}: ${err.stack}`);
- res.status(StatusCodes.INTERNAL_SERVER_ERROR).send($$('org.crazydoctor.expressts.httpError.500'));
- };
- }
- export default InternalServerErrorHandler;
|