Error
The Error package is a kernel that manages the errors and uses the errorHelper to expose an API.
Error helper
The errorHelper manages the error handling of the application.
getError$
Returns a Rx.Observable to subscribe to new incoming errors.
Usage
Copy
getError$(): Rx.Observable<{error: Error, module: Object}>
Returns
-
Rx.Observable<{error: Error, module: Object}>
Errors observable.
Example
Copy
errorHelper.getError$().subscribe((errorReport) => {
console.error('Found error in module', errorReport.module, errorReport.error);
});
report
Reports a new error; all the subscribers will receive it.
Usage
Copy
report((error: Error));
-
error Error
The error to be reported.
Example
Copy
errorHelper.report(new Error('My plugin throws an Error'));