Shutdown notice: Errorception is shutting down on 30th June. Read more.

Using Errorception with your library

Some libraries need a little coaxing to reveal their errors

In most cases, you won't need to make any modifications to your code to work with Errorception. However, some libraries hijack error bubbling. Such libraries need a little coaxing to reveal their errors.


Simply copy-paste the following code into your scripts:

app.config(function($provide) {
  $provide.decorator("$exceptionHandler", ['$delegate', function($delegate) {
    return function(exception, cause) {
      $delegate(exception, cause);

This code above decorates the $exceptionHandler service to call _errs.push when errors occur. It also calls $delegate, so that the original behaviour of outputting to the console isn't disturbed.


(function() {
  var reportError = function(e) { _errs.push(e); };
  Ember.onerror = reportError;
  Ember.RSVP.configure('onerror', reportError);
  App.ApplicationRoute = Ember.Route.extend({actions: {error: reportError}});

The code above sets up the Ember.onerror handler for your app. It also sets up RSVP error notifications, and notifications for any errors with route resolution.