@nestjs/core
Version:
Nest - modern, fast, powerful node.js web framework (@core)
18 lines (17 loc) • 606 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const execution_context_host_1 = require("../helpers/execution-context-host");
class ExternalErrorProxy {
createProxy(targetCallback, exceptionsHandler) {
return async (...args) => {
try {
return await targetCallback(...args);
}
catch (e) {
const host = new execution_context_host_1.ExecutionContextHost(args);
return exceptionsHandler.next(e, host);
}
};
}
}
exports.ExternalErrorProxy = ExternalErrorProxy;