Global error handling in Aurelia

Can anyone help me and suggest a way to global error handling in Aurelia like Global Error Handling with Angular2+

Is it possible? any doc or sample?

For rejected promise (most errors from aurelia are unhandled promise rejection), use bluebird global events.

window.addEventListener("unhandledrejection", function(e) {});
window.addEventListener("rejectionhandled", function(e) {});

1 Like

As I remembered we use Bluebird for supporting promises in Edge browser Am I right?

so with your solution we should use Bluebird everywhere Yes?

I thought it is used everywhere. The default bootstrapped aurelia app by cli uses Bluebird by default.

1 Like

Most people swapped out bluebird for a lighter polyfill so that is quite specific unfortunately


@EisenbergEffect, What do you think? Is there any Aurelia based solution for this? (not BlueBird)

Have a look at this method _flushQueue :

You can override it and intercept onError by your own global error handler.

1 Like