Skip to content

Commit

Permalink
Improves Bugsnag reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
twokul committed Mar 17, 2015
1 parent 044b9dc commit d3407be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var currentEnv = config.environment;
export default {
name: 'bugsnag-error-service',

initialize: function() {
initialize: function(container) {
if (Bugsnag.notifyReleaseStages.indexOf(currentEnv) !== -1) {
Ember.onerror = function (error) {
Bugsnag.context = container.lookup('router:main').get('location').getURL();
Expand Down
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ module.exports = {
contentFor: function(type, config) {
var content = '';
var bugsnagConfig;
var envArray;

if (type === 'head') {
if (type === 'head' && config.environment !== 'test') {
bugsnagConfig = readConfig();
envArray = bugsnagConfig.notifyReleaseStages ? bugsnagConfig.notifyReleaseStages : [];

content = [
'<script ',
Expand All @@ -21,7 +23,7 @@ module.exports = {
'</script>',
'<script>',
'Bugsnag.releaseStage = "' + config.environment + '";',
'Bugsnag.notifyReleaseStages = ["' + bugsnagConfig.notifyReleaseStages.join('","') + '"];',
'Bugsnag.notifyReleaseStages = ["' + envArray.join('","') + '"];',
'</script>'
];
}
Expand Down
2 changes: 1 addition & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = function readConfig() {
throw new Error('`.bugsnag` config file is malformed: ' + e.message);
}
} else {
throw new Error('Please, check if `.newrelic` configuration file exists.');
throw new Error('Please, check if `.bugsnag` configuration file exists.');
}

return config;
Expand Down

0 comments on commit d3407be

Please sign in to comment.