Ember Bugsnag
Bugsnag integration for Ember applications.
Compatibility
- Ember.js v3.24 or above
- Ember CLI v3.24 or above
- Node.js v12 or above
Installation
ember install @bagaar/ember-bugsnag
Usage
Setup
// config/environment.js
'use strict';
module.exports = function (environment) {
let ENV = {
'@bagaar/ember-bugsnag': {
autostart: true,
bugsnagOptions: {
apiKey: 'c917462977a5ee28ad3683c829939e16',
enabledReleaseStages: ['develop', 'acceptance', 'production'],
releaseStage: 'production',
},
},
};
};
bugsnagOptions
can take any of the valid Bugsnag configuration options.
// app/routes/application.js
import Route from '@ember/routing/route';
import { service } from '@ember/service';
export default class ApplicationRoute extends Route {
@service('bugsnag') bugsnagService;
beforeModel() {
this.bugsnagService.setup();
}
}
Reporting Handled Errors
// app/components/foo.js
import { action } from '@ember/object';
import { service } from '@ember/service';
import Component from '@glimmer/component';
export default class FooComponent extends Component {
@service('bugsnag') bugsnagService;
@action
async someAction() {
try {
await somethingThatIsNotSupposedToFail();
} catch (error) {
this.bugsnagService.notify(error);
}
}
}
notify
will fall back to using console.error
if Bugsnag has not yet been started.
Contributing
See the Contributing guide for details.
License
This project is licensed under the MIT License.