diff --git a/app/src/main/java/com/etesync/syncadapter/syncadapter/CalendarSyncManager.kt b/app/src/main/java/com/etesync/syncadapter/syncadapter/CalendarSyncManager.kt index 1e3ee89d..b192a118 100644 --- a/app/src/main/java/com/etesync/syncadapter/syncadapter/CalendarSyncManager.kt +++ b/app/src/main/java/com/etesync/syncadapter/syncadapter/CalendarSyncManager.kt @@ -78,7 +78,7 @@ constructor(context: Context, account: Account, settings: AccountSettings, extra } @Throws(IOException::class, ContactsStorageException::class, CalendarStorageException::class, InvalidCalendarException::class) - override fun processSyncEntry(cEntry: SyncEntry) { + override fun processSyncEntryImpl(cEntry: SyncEntry) { val inputReader = StringReader(cEntry.content) val events = Event.fromReader(inputReader) diff --git a/app/src/main/java/com/etesync/syncadapter/syncadapter/ContactsSyncManager.kt b/app/src/main/java/com/etesync/syncadapter/syncadapter/ContactsSyncManager.kt index f1a32d09..ee87763e 100644 --- a/app/src/main/java/com/etesync/syncadapter/syncadapter/ContactsSyncManager.kt +++ b/app/src/main/java/com/etesync/syncadapter/syncadapter/ContactsSyncManager.kt @@ -127,7 +127,7 @@ constructor(context: Context, account: Account, settings: AccountSettings, extra } @Throws(IOException::class, ContactsStorageException::class, CalendarStorageException::class) - override fun processSyncEntry(cEntry: SyncEntry) { + override fun processSyncEntryImpl(cEntry: SyncEntry) { val inputReader = StringReader(cEntry.content) val contacts = Contact.fromReader(inputReader, resourceDownloader) diff --git a/app/src/main/java/com/etesync/syncadapter/syncadapter/SyncManager.kt b/app/src/main/java/com/etesync/syncadapter/syncadapter/SyncManager.kt index 0b7ce64e..493f7872 100644 --- a/app/src/main/java/com/etesync/syncadapter/syncadapter/SyncManager.kt +++ b/app/src/main/java/com/etesync/syncadapter/syncadapter/SyncManager.kt @@ -288,7 +288,16 @@ constructor(protected val context: Context, protected val account: Account, prot } @Throws(IOException::class, ContactsStorageException::class, CalendarStorageException::class, InvalidCalendarException::class) - protected abstract fun processSyncEntry(cEntry: SyncEntry) + protected abstract fun processSyncEntryImpl(cEntry: SyncEntry) + + protected fun processSyncEntry(cEntry: SyncEntry) { + try { + processSyncEntryImpl(cEntry) + } catch (e: Exception) { + Logger.log.warning("Failed processing entry: ${cEntry.content}") + throw e + } + } private fun persistSyncEntry(uid: String?, syncEntry: SyncEntry) { val entry = EntryEntity() diff --git a/app/src/main/java/com/etesync/syncadapter/syncadapter/TasksSyncManager.kt b/app/src/main/java/com/etesync/syncadapter/syncadapter/TasksSyncManager.kt index 9539e8a6..2d2f22bc 100644 --- a/app/src/main/java/com/etesync/syncadapter/syncadapter/TasksSyncManager.kt +++ b/app/src/main/java/com/etesync/syncadapter/syncadapter/TasksSyncManager.kt @@ -68,7 +68,7 @@ class TasksSyncManager( return localCollection as LocalTaskList } - override fun processSyncEntry(cEntry: SyncEntry) { + override fun processSyncEntryImpl(cEntry: SyncEntry) { val inputReader = StringReader(cEntry.content) val tasks = Task.fromReader(inputReader)