HEX
Server: nginx/1.24.0
System: Linux nowruzgan 6.8.0-57-generic #59-Ubuntu SMP PREEMPT_DYNAMIC Sat Mar 15 17:40:59 UTC 2025 x86_64
User: babak (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/dev/shahnamag/back-end/node_modules/@nestjs/core/errors/exceptions-zone.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExceptionsZone = void 0;
const common_1 = require("@nestjs/common");
const exception_handler_1 = require("./exception-handler");
const DEFAULT_TEARDOWN = () => process.exit(1);
class ExceptionsZone {
    static run(callback, teardown = DEFAULT_TEARDOWN, autoFlushLogs) {
        try {
            callback();
        }
        catch (e) {
            this.exceptionHandler.handle(e);
            if (autoFlushLogs) {
                common_1.Logger.flush();
            }
            teardown(e);
        }
    }
    static async asyncRun(callback, teardown = DEFAULT_TEARDOWN, autoFlushLogs) {
        try {
            await callback();
        }
        catch (e) {
            this.exceptionHandler.handle(e);
            if (autoFlushLogs) {
                common_1.Logger.flush();
            }
            teardown(e);
        }
    }
}
exports.ExceptionsZone = ExceptionsZone;
ExceptionsZone.exceptionHandler = new exception_handler_1.ExceptionHandler();