Custom Exception Handler

Hi all!

I’ve been trying to implement my own ExceptionHandler and followed the docs: https://angular.io/docs/ts/latest/api/core/ExceptionHandler-class.html

However, I am using ES6, so I can’t implement interfaces.
I couldn’t get the call method trigger :/

Also, the docs say “export class” but use it as an interface (“implements ExceptionHandler”), is this correct?

This is my ExceptionHandler:

import { ExceptionHandler } from 'angular2/core';

export class WtExceptionHandler extends ExceptionHandler {
  call(error, stackTrace = null, reason = null) {
    console.log("hello");
  }
}

But my transpiled code shows ‘call’ method as:

call(error) { ... } // And stackTrace and reason comes from arguments. Could this be the issue?

Best regards,
tbragaf

2 thoughts on “Custom Exception Handler