UNPKG

715 BTypeScriptView Raw
1/**
2 * @whatItDoes Provides a hook for centralized exception handling.
3 *
4 * @description
5 *
6 * The default implementation of `ErrorHandler` prints error messages to the `console`. To
7 * intercept error handling, write a custom exception handler that replaces this default as
8 * appropriate for your app.
9 *
10 * ### Example
11 *
12 * ```
13 * class MyErrorHandler implements ErrorHandler {
14 * handleError(error) {
15 * // do something with the exception
16 * }
17 * }
18 *
19 * @NgModule({
20 * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
21 * })
22 * class MyModule {}
23 * ```
24 *
25 * @stable
26 */
27export declare class ErrorHandler {
28 constructor(rethrowError?: boolean);
29 handleError(error: any): void;
30}