UNPKG

685 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.ExternalErrorProxy = void 0;
4const execution_context_host_1 = require("../helpers/execution-context-host");
5class ExternalErrorProxy {
6 createProxy(targetCallback, exceptionsHandler, type) {
7 return async (...args) => {
8 try {
9 return await targetCallback(...args);
10 }
11 catch (e) {
12 const host = new execution_context_host_1.ExecutionContextHost(args);
13 host.setType(type);
14 return exceptionsHandler.next(e, host);
15 }
16 };
17 }
18}
19exports.ExternalErrorProxy = ExternalErrorProxy;