wishthis/node_modules/rxjs/_esm2015/internal/util/tryCatch.js
2022-05-29 11:24:36 +02:00

20 lines
No EOL
442 B
JavaScript

import { errorObject } from './errorObject';
let tryCatchTarget;
function tryCatcher() {
errorObject.e = undefined;
try {
return tryCatchTarget.apply(this, arguments);
}
catch (e) {
errorObject.e = e;
return errorObject;
}
finally {
tryCatchTarget = undefined;
}
}
export function tryCatch(fn) {
tryCatchTarget = fn;
return tryCatcher;
}
//# sourceMappingURL=tryCatch.js.map