Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

sentry / @nestjs/core   js

Repository URL to install this package:

Version: 7.0.10 

/ errors / exceptions-zone.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const exception_handler_1 = require("./exception-handler");
const DEFAULT_TEARDOWN = () => process.exit(1);
class ExceptionsZone {
    static run(callback, teardown = DEFAULT_TEARDOWN) {
        try {
            callback();
        }
        catch (e) {
            this.exceptionHandler.handle(e);
            teardown(e);
        }
    }
    static async asyncRun(callback, teardown = DEFAULT_TEARDOWN) {
        try {
            await callback();
        }
        catch (e) {
            this.exceptionHandler.handle(e);
            teardown(e);
        }
    }
}
exports.ExceptionsZone = ExceptionsZone;
ExceptionsZone.exceptionHandler = new exception_handler_1.ExceptionHandler();