1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 1 1 1 26445 26445 120 120 1 26445 26445 | import {errorObject} from './errorObject'; let tryCatchTarget; function tryCatcher(): any { try { return tryCatchTarget.apply(this, arguments); } catch (e) { errorObject.e = e; return errorObject; } } export function tryCatch(fn: Function): Function { tryCatchTarget = fn; return tryCatcher; }; |