Skip to content

Instantly share code, notes, and snippets.

@Sarthak2601
Created August 30, 2020 14:56
Show Gist options
  • Save Sarthak2601/87bbcccb5b5bed009a7338f1a5090bac to your computer and use it in GitHub Desktop.
Save Sarthak2601/87bbcccb5b5bed009a7338f1a5090bac to your computer and use it in GitHub Desktop.
private fun uploadExceptions(): Result =
try {
val exceptionLogs = runBlocking {
exceptionsController.getExceptionLogStore().retrieveData()
}.getOrThrow().exceptionLogList
for (exceptionLog in exceptionLogs) {
exceptionLogger.logException(exceptionLog.toException())
exceptionLogs.remove(exceptionLog)
}
Result.success()
} catch (e: Exception) {
consoleLogger.e(TAG, e.toString(), e)
Result.failure()
}
private fun uploadEvents(): Result {
return try {
val eventLogs = runBlocking {
analyticsController.getEventLogStore().retrieveData()
}.getOrThrow().eventLogList
for (eventLog in eventLogs) {
eventLogger.logEvent(eventLog)
eventLogs.remove(eventLog)
}
Result.success()
} catch (e: Exception) {
consoleLogger.e(TAG, e.toString(), e)
Result.failure()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment