UNPKG

663 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const runtime_exception_1 = require("./exceptions/runtime.exception");
4const logger_service_1 = require("@nestjs/common/services/logger.service");
5class ExceptionHandler {
6 handle(exception) {
7 if (!(exception instanceof runtime_exception_1.RuntimeException)) {
8 ExceptionHandler.logger.error(exception.message, exception.stack);
9 return;
10 }
11 ExceptionHandler.logger.error(exception.what(), exception.stack);
12 }
13}
14exports.ExceptionHandler = ExceptionHandler;
15ExceptionHandler.logger = new logger_service_1.Logger(ExceptionHandler.name);