Created
August 30, 2020 14:56
-
-
Save Sarthak2601/87bbcccb5b5bed009a7338f1a5090bac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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