mirror of
https://github.com/etesync/android
synced 2024-11-22 07:58:09 +00:00
Sync: log broken entries on processing failure.
This change prints the content of broken entries (ones that fail parsing) to the log so it's easier to debug issues.
This commit is contained in:
parent
fb2ed34379
commit
1a7ef1b78e
@ -78,7 +78,7 @@ constructor(context: Context, account: Account, settings: AccountSettings, extra
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Throws(IOException::class, ContactsStorageException::class, CalendarStorageException::class, InvalidCalendarException::class)
|
@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 inputReader = StringReader(cEntry.content)
|
||||||
|
|
||||||
val events = Event.fromReader(inputReader)
|
val events = Event.fromReader(inputReader)
|
||||||
|
@ -127,7 +127,7 @@ constructor(context: Context, account: Account, settings: AccountSettings, extra
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Throws(IOException::class, ContactsStorageException::class, CalendarStorageException::class)
|
@Throws(IOException::class, ContactsStorageException::class, CalendarStorageException::class)
|
||||||
override fun processSyncEntry(cEntry: SyncEntry) {
|
override fun processSyncEntryImpl(cEntry: SyncEntry) {
|
||||||
val inputReader = StringReader(cEntry.content)
|
val inputReader = StringReader(cEntry.content)
|
||||||
|
|
||||||
val contacts = Contact.fromReader(inputReader, resourceDownloader)
|
val contacts = Contact.fromReader(inputReader, resourceDownloader)
|
||||||
|
@ -288,7 +288,16 @@ constructor(protected val context: Context, protected val account: Account, prot
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Throws(IOException::class, ContactsStorageException::class, CalendarStorageException::class, InvalidCalendarException::class)
|
@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) {
|
private fun persistSyncEntry(uid: String?, syncEntry: SyncEntry) {
|
||||||
val entry = EntryEntity()
|
val entry = EntryEntity()
|
||||||
|
@ -68,7 +68,7 @@ class TasksSyncManager(
|
|||||||
return localCollection as LocalTaskList
|
return localCollection as LocalTaskList
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun processSyncEntry(cEntry: SyncEntry) {
|
override fun processSyncEntryImpl(cEntry: SyncEntry) {
|
||||||
val inputReader = StringReader(cEntry.content)
|
val inputReader = StringReader(cEntry.content)
|
||||||
|
|
||||||
val tasks = Task.fromReader(inputReader)
|
val tasks = Task.fromReader(inputReader)
|
||||||
|
Loading…
Reference in New Issue
Block a user