UNPKG

902 BTypeScriptView Raw
1/**
2 * Provides a hook for centralized exception handling.
3 *
4 * The default implementation of `ExceptionHandler` prints error messages to the `Console`. To
5 * intercept error handling,
6 * write a custom exception handler that replaces this default as appropriate for your app.
7 *
8 * ### Example
9 *
10 * ```javascript
11 *
12 * class MyExceptionHandler implements ExceptionHandler {
13 * call(error, stackTrace = null, reason = null) {
14 * // do something with the exception
15 * }
16 * }
17 *
18 * bootstrap(MyApp, {provide: ExceptionHandler, useClass: MyExceptionHandler}])
19 *
20 * ```
21 * @stable
22 */
23export declare class ExceptionHandler {
24 private _logger;
25 private _rethrowException;
26 constructor(_logger: any, _rethrowException?: boolean);
27 static exceptionToString(exception: any, stackTrace?: any, reason?: string): string;
28 call(exception: any, stackTrace?: any, reason?: string): void;
29}