diff --git a/static/js/services/user-service.js b/static/js/services/user-service.js index d6bce37cc..ca693b74a 100644 --- a/static/js/services/user-service.js +++ b/static/js/services/user-service.js @@ -37,32 +37,44 @@ function(ApiService, CookieService, $rootScope, Config) { if (!userResponse.anonymous) { if (Config.MIXPANEL_KEY) { - mixpanel.identify(userResponse.username); - mixpanel.people.set({ - '$email': userResponse.email, - '$username': userResponse.username, - 'verified': userResponse.verified - }); - mixpanel.people.set_once({ - '$created': new Date() - }) + try { + mixpanel.identify(userResponse.username); + mixpanel.people.set({ + '$email': userResponse.email, + '$username': userResponse.username, + 'verified': userResponse.verified + }); + mixpanel.people.set_once({ + '$created': new Date() + }) + } catch (e) { + window.console.log(e); + } } if (window.olark !== undefined) { - olark('api.visitor.getDetails', function(details) { - if (details.fullName === null) { - olark('api.visitor.updateFullName', {fullName: userResponse.username}); - } - }); - olark('api.visitor.updateEmailAddress', {emailAddress: userResponse.email}); - olark('api.chat.updateVisitorStatus', {snippet: 'username: ' + userResponse.username}); + try { + olark('api.visitor.getDetails', function(details) { + if (details.fullName === null) { + olark('api.visitor.updateFullName', {fullName: userResponse.username}); + } + }); + olark('api.visitor.updateEmailAddress', {emailAddress: userResponse.email}); + olark('api.chat.updateVisitorStatus', {snippet: 'username: ' + userResponse.username}); + } catch (e) { + window.console.log(e); + } } if (window.Raven !== undefined) { - Raven.setUser({ - email: userResponse.email, - id: userResponse.username - }); + try { + Raven.setUser({ + email: userResponse.email, + id: userResponse.username + }); + } catch (e) { + window.console.log(e); + } } CookieService.putPermanent('quay.loggedin', 'true');