Code coverage report for src/util/tryCatch.ts

Statements: 100% (11 / 11)      Branches: 100% (0 / 0)      Functions: 100% (2 / 2)      Lines: 100% (10 / 10)      Ignored: none     

All files » src/util/ » tryCatch.ts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171   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;
};