Skip to content

Commit

Permalink
Add more detail to sentry errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kleinsch committed Sep 6, 2013
1 parent 2dfca3b commit 0455aea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/lib/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Balanced.Analytics = (function () {
function trackLogin(email) {
try {
window.mixpanel.alias(email);
Raven.setUser({
email: email
});
} catch (err) {
}
}
Expand Down
13 changes: 12 additions & 1 deletion app/lib/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@ if (typeof Raven !== typeof undefined) {
var realError = error.stack || error;

if (!ENV.BALANCED.DEBUG) {
Raven.captureException(realError);
var data = {
text: error.message || realError.toString(),
location: window.location.toString()
};
if(Balanced.currentMarketplace) {
data.marketplaceId = Balanced.currentMarketplace.get('id');
data.marketplaceName = Balanced.currentMarketplace.get('name');
}

Raven.captureException(realError, {tags: data});

Balanced.Analytics.trackEvent('js-error', data);
}

Ember.Logger.error(realError);
Expand Down

0 comments on commit 0455aea

Please sign in to comment.