UNPKG

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