Skip to content

Commit

Permalink
Do not report user about network error in sync (device offline)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomas2 committed Jun 23, 2023
1 parent e043525 commit c21c510
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/src/main/java/net/bible/service/cloudsync/CloudSync.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import net.bible.service.common.CommonUtils
import net.bible.service.common.asyncMap
import net.bible.service.db.DatabaseContainer
import java.io.FileNotFoundException
import java.io.IOException
import java.net.SocketTimeoutException
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
Expand Down Expand Up @@ -368,6 +369,9 @@ object CloudSync {
} catch (e: SocketTimeoutException) {
Log.i(TAG, "Socket timed out")
return@asyncMap
} catch (e: IOException) {
Log.i(TAG, "IOException (probably network down)")
return@asyncMap
} catch (e: Exception) {
Log.e(TAG, "Some other exception happened in initializeSync!", e)
ABEventBus.post(BibleApplication.ErrorNotificationEvent(R.string.sync_error))
Expand Down

0 comments on commit c21c510

Please sign in to comment.