Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4359c2f2 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

chore: explore how to trigger notification. Commit to remove before merge

parent c7a88e41
Loading
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -367,10 +367,6 @@ abstract class SyncManager<ResourceType: LocalResource<*>, out CollectionType: L
                is InvalidAccountException ->
                    throw e

                is UnauthorizedException -> {
                    Log.d("Vincent", "caught unauthorized exception"+e.message)

                }
                // specific I/O errors
                is SSLHandshakeException -> {
                    Logger.log.log(Level.WARNING, "SSL handshake failed", e)
@@ -395,6 +391,13 @@ abstract class SyncManager<ResourceType: LocalResource<*>, out CollectionType: L
                    return@unwrapExceptions
                }

                // Caught HTTP 401 : user need to relogin/update credentials
                // In this case we want to show a notification to indicate it to the user
                is UnauthorizedException -> {
                    Log.d("Vincent", "caught unauthorized exception "+e.message)
                    notifyException(e, local, remote)
                }

                // all others
                else -> {
                    // sometimes sync is kicked in when no network is not available.
@@ -861,7 +864,6 @@ abstract class SyncManager<ResourceType: LocalResource<*>, out CollectionType: L
                syncResult.stats.numIoExceptions++
            }
            is UnauthorizedException -> {
                Log.d("vincent", "unauthorizedException has been caught. Try to show a notif")
                message = context.getString(R.string.sync_error_authentication_failed)
                syncResult.stats.numAuthExceptions++