Skip to content

Commit

Permalink
Merge pull request #210 from Infomaniak/appUpdate-exceptions
Browse files Browse the repository at this point in the history
Catch PlayServices AppUpdate exceptions to better understand what's happening
  • Loading branch information
tevincent authored Jul 23, 2024
2 parents 388ee4f + d5ee196 commit b17b710
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import com.google.common.util.concurrent.ListenableFuture
import com.infomaniak.lib.core.utils.SentryLog
import com.infomaniak.lib.stores.updatemanagers.WorkerUpdateManager
import io.sentry.Sentry
import io.sentry.SentryLevel
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -78,7 +79,10 @@ class AppUpdateScheduler(
updateManager.installDownloadedUpdate(
onInstallSuccess = { completer.setResult(Result.success()) },
onInstallFailure = { exception ->
Sentry.captureException(exception)
Sentry.withScope {scope ->
scope.setTag("message", exception.message ?: "Unknown error")
Sentry.captureMessage("AppUpdate throwed an exception", SentryLevel.INFO)
}
completer.setResult(Result.failure())
},
)
Expand Down

0 comments on commit b17b710

Please sign in to comment.