You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
442 B
20 lines
442 B
4 years ago
|
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
|