1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

Add try/catch logic to recording of analytics events

This commit is contained in:
Jannick Hemelhof
2017-10-09 10:45:09 +02:00
parent c39e5c67f5
commit f7cdafb087

View File

@@ -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 = {