Merge pull request #6013 from tudi2d/4782-forward-unhandled-errors

Catch unhandled promise rejections & forward them to the ErrorApi
This commit is contained in:
Ben Lambert
2021-06-22 15:56:21 +02:00
committed by GitHub
7 changed files with 54 additions and 4 deletions
+5 -2
View File
@@ -71,8 +71,11 @@ For example, this is the default `ApiFactory` for the `ErrorApi`:
createApiFactory({
api: errorApiRef,
deps: { alertApi: alertApiRef },
factory: ({ alertApi }) =>
new ErrorAlerter(alertApi, new ErrorApiForwarder()),
factory: ({ alertApi }) => {
const errorApi = new ErrorAlerter(alertApi, new ErrorApiForwarder());
UnhandledErrorForwarder.forward(errorApi, { hidden: false });
return errorApi;
},
});
```