Code coverage report for src/util/tryOrOnError.ts

Statements: 100% (8 / 8)      Branches: 100% (0 / 0)      Functions: 100% (2 / 2)      Lines: 100% (7 / 7)      Ignored: none     

All files » src/util/ » tryOrOnError.ts
1 2 3 4 5 6 7 8 9 10 11 121 1 4841 4841   4     2165 2165    
export function tryOrOnError(target: Function): (x?: any) => any {
  function tryCatcher() {
    try {
      (<any> tryCatcher).target.apply(this, arguments);
    } catch (e) {
      this.error(e);
    }
  }
  (<any> tryCatcher).target = target;
  return tryCatcher;
}