Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add try/catch logic to recording of analytics events
  • Loading branch information
jhemelhof committed Oct 9, 2017
commit f7cdafb0878c66414ecb5024d85a760cfe7826af
16 changes: 12 additions & 4 deletions browser/main/lib/AwsMobileAnalyticsConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,22 @@ function initAwsMobileAnalytics () {

function recordDynamicCustomEvent (type) {
if (process.env.NODE_ENV !== 'production' || !ConfigManager.default.get().amaEnabled) return
mobileAnalyticsClient.recordEvent(type)
try {
mobileAnalyticsClient.recordEvent(type)
} catch (analyticsError) {
console.error(analyticsError)
}
}

function recordStaticCustomEvent () {
if (process.env.NODE_ENV !== 'production' || !ConfigManager.default.get().amaEnabled) return
mobileAnalyticsClient.recordEvent('UI_COLOR_THEME', {
uiColorTheme: ConfigManager.default.get().ui.theme
})
try {
mobileAnalyticsClient.recordEvent('UI_COLOR_THEME', {
uiColorTheme: ConfigManager.default.get().ui.theme
})
} catch (analyticsError) {
console.error(analyticsError)
}
}

module.exports = {
Expand Down