1 2 3 4 5 6 7 8 9 10 11 12 | 1 1 4521 4521 4 2016 2016 | 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; } |