Skip to content

Commit

Permalink
Merge pull request #12 from tallarium/better-ignore-error
Browse files Browse the repository at this point in the history
the error parameter is often undefined
  • Loading branch information
Duncan Walker authored Jan 29, 2017
2 parents b6291df + 77a1cce commit b13085c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions addon/instance-initializers/new-relic.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export function initialize() {
function mustIgnoreError(error) {
// Ember 2.X seems to not catch `TransitionAborted` errors caused by regular redirects. We don't want these errors to show up in NewRelic so we have to filter them ourselfs.
// Once the issue https://github.com/emberjs/ember.js/issues/12505 is resolved we can remove this ignored error.
return (error.name === 'TransitionAborted');
if (Ember.isNone(error)) {
return false;
}
const errorName = Ember.get(error, 'name');
return errorName === 'TransitionAborted';
}

function handleError(error) {
Expand All @@ -24,7 +28,9 @@ export function initialize() {
// Ignore
}

console.error(error.stack);
if (error && error.stack) {
console.error(error.stack);
}
}

function generateError(cause, stack) {
Expand Down

0 comments on commit b13085c

Please sign in to comment.