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