1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.ExternalErrorProxy = void 0;
|
4 | const execution_context_host_1 = require("../helpers/execution-context-host");
|
5 | class 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 | }
|
19 | exports.ExternalErrorProxy = ExternalErrorProxy;
|