Skip to content

Instantly share code, notes, and snippets.

@zdenal
Last active August 29, 2015 14:16
Show Gist options
  • Save zdenal/253f7d24c16dcbca7d44 to your computer and use it in GitHub Desktop.
Save zdenal/253f7d24c16dcbca7d44 to your computer and use it in GitHub Desktop.
{
"predef": {
...
"Bugsnag": true,
...
},
...
}
{
...
"dependencies": {
...
"bugsnag": "~2.4.7"
}
}
...
var app = new EmberApp({
...
sourcemaps: {
"enabled": true,
"extensions": ["js"]
}
});
app.import('bower_components/bugsnag/src/bugsnag.js');
...
import Ember from 'ember';
import config from '../config/environment';
export default {
name: 'bugsnag',
after: 'authentication',
initialize: function(container) {
var appController = container.lookup('controller:application');
Bugsnag.apiKey = config.APP.BUGSNAG.API_KEY;
Bugsnag.releaseStage = config.environment;
Bugsnag.notifyReleaseStages = ["staging", "production"];
// Routing errors and edge cases
Ember.onerror = function(error) {
Bugsnag.context = appController.get('currentPath');
Bugsnag.notifyException(error);
};
// Errors that occur in Promises
Ember.RSVP.on('error', function (error) {
Bugsnag.context = appController.get('currentPath');
Bugsnag.notifyException(error);
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment