1
0
mirror of https://github.com/etesync/android synced 2024-11-26 01:48:34 +00:00

Add missing exception handling to contacts sync.

It wasn't handling IgnorableException.
This commit is contained in:
Tom Hacohen 2019-05-01 09:15:14 +01:00
parent 1d5bcc6a3d
commit 6250cacd30

View File

@ -62,6 +62,11 @@ class ContactsSyncAdapterService : SyncAdapterService() {
ContactsSyncManager(context, account, settings, extras, authority, provider, syncResult, addressBook, principal).use { ContactsSyncManager(context, account, settings, extras, authority, provider, syncResult, addressBook, principal).use {
it.performSync() it.performSync()
} }
} catch (e: Exceptions.ServiceUnavailableException) {
syncResult.stats.numIoExceptions++
syncResult.delayUntil = if (e.retryAfter > 0) e.retryAfter else Constants.DEFAULT_RETRY_DELAY
} catch (e: Exceptions.IgnorableHttpException) {
// Ignore
} catch (e: Exception) { } catch (e: Exception) {
val syncPhase = R.string.sync_phase_journals val syncPhase = R.string.sync_phase_journals
val title = context.getString(R.string.sync_error_contacts, account.name) val title = context.getString(R.string.sync_error_contacts, account.name)