InternalServerErrorHandler.js 687 B

1234567891011121314151617
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const http_1 = require("../base/http");
  4. const i18n_1 = require("../base/i18n");
  5. class InternalServerErrorHandler extends http_1.Middleware {
  6. constructor() {
  7. super(...arguments);
  8. this.order = 10000;
  9. this.route = null;
  10. this.action = (err, req, res, next) => {
  11. this.context.logError(`${err.message}: ${err.stack}`);
  12. res.status(http_1.StatusCodes.INTERNAL_SERVER_ERROR).send((0, i18n_1.$$)('org.crazydoctor.expressts.httpError.500'));
  13. };
  14. }
  15. }
  16. exports.default = InternalServerErrorHandler;
  17. //# sourceMappingURL=InternalServerErrorHandler.js.map