UNPKG

angular2

Version:

Angular 2 - a web framework for modern web apps

29 lines (28 loc) 920 B
/** * Provides a hook for centralized exception handling. * * The default implementation of `ExceptionHandler` prints error messages to the `Console`. To * intercept error handling, * write a custom exception handler that replaces this default as appropriate for your app. * * ### Example * * ```javascript * * class MyExceptionHandler implements ExceptionHandler { * call(error, stackTrace = null, reason = null) { * // do something with the exception * } * } * * bootstrap(MyApp, [provide(ExceptionHandler, {useClass: MyExceptionHandler})]) * * ``` */ export declare class ExceptionHandler { private _logger; private _rethrowException; constructor(_logger: any, _rethrowException?: boolean); static exceptionToString(exception: any, stackTrace?: any, reason?: string): string; call(exception: any, stackTrace?: any, reason?: string): void; }