catch Exceptions thrown at updating calendars
This commit is contained in:
parent
c1a59f36a7
commit
a914b2e593
19 changed files with 23 additions and 2 deletions
|
@ -75,7 +75,7 @@ class UpdateEventTypeDialog(val activity: Activity, var eventType: EventType? =
|
|||
dismiss()
|
||||
callback.invoke(eventTypeId)
|
||||
} else {
|
||||
activity.toast(R.string.unknown_error_occurred)
|
||||
activity.toast(R.string.editing_calendar_failed)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -83,7 +83,11 @@ class CalDAVHandler(val context: Context) {
|
|||
val uri = CalendarContract.Calendars.CONTENT_URI
|
||||
val values = fillCalendarContentValues(eventType)
|
||||
val newUri = ContentUris.withAppendedId(uri, eventType.caldavCalendarId.toLong())
|
||||
return context.contentResolver.update(newUri, values, null, null) == 1
|
||||
return try {
|
||||
context.contentResolver.update(newUri, values, null, null) == 1
|
||||
} catch (e: IllegalArgumentException) {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
private fun fillCalendarContentValues(eventType: EventType): ContentValues {
|
||||
|
|
|
@ -199,6 +199,7 @@
|
|||
<string name="refresh_caldav_calendars">Refresh CalDAV calendars</string>
|
||||
<string name="refreshing">Refreshing…</string>
|
||||
<string name="refreshing_complete">Refreshing complete</string>
|
||||
<string name="editing_calendar_failed">Editing calendar failed</string>
|
||||
|
||||
<plurals name="by_minutes">
|
||||
<item quantity="one">%1$d minute</item>
|
||||
|
|
|
@ -199,6 +199,7 @@
|
|||
<string name="refresh_caldav_calendars">Refresh CalDAV calendars</string>
|
||||
<string name="refreshing">Refreshing…</string>
|
||||
<string name="refreshing_complete">Refreshing complete</string>
|
||||
<string name="editing_calendar_failed">Editing calendar failed</string>
|
||||
|
||||
<plurals name="by_minutes">
|
||||
<item quantity="one">%1$d minute</item>
|
||||
|
|
|
@ -199,6 +199,7 @@
|
|||
<string name="refresh_caldav_calendars">Refresh CalDAV calendars</string>
|
||||
<string name="refreshing">Refreshing…</string>
|
||||
<string name="refreshing_complete">Refreshing complete</string>
|
||||
<string name="editing_calendar_failed">Editing calendar failed</string>
|
||||
|
||||
<plurals name="by_minutes">
|
||||
<item quantity="one">%1$d minute</item>
|
||||
|
|
|
@ -199,6 +199,7 @@
|
|||
<string name="refresh_caldav_calendars">Refresh CalDAV calendars</string>
|
||||
<string name="refreshing">Refreshing…</string>
|
||||
<string name="refreshing_complete">Refreshing complete</string>
|
||||
<string name="editing_calendar_failed">Editing calendar failed</string>
|
||||
|
||||
<plurals name="by_minutes">
|
||||
<item quantity="one">%1$d minute</item>
|
||||
|
|
|
@ -199,6 +199,7 @@
|
|||
<string name="refresh_caldav_calendars">Refresh CalDAV calendars</string>
|
||||
<string name="refreshing">Refreshing…</string>
|
||||
<string name="refreshing_complete">Refreshing complete</string>
|
||||
<string name="editing_calendar_failed">Editing calendar failed</string>
|
||||
|
||||
<plurals name="by_minutes">
|
||||
<item quantity="one">%1$d minute</item>
|
||||
|
|
|
@ -199,6 +199,7 @@
|
|||
<string name="refresh_caldav_calendars">Refresh CalDAV calendars</string>
|
||||
<string name="refreshing">Refreshing…</string>
|
||||
<string name="refreshing_complete">Refreshing complete</string>
|
||||
<string name="editing_calendar_failed">Editing calendar failed</string>
|
||||
|
||||
<plurals name="by_minutes">
|
||||
<item quantity="one">%1$d minute</item>
|
||||
|
|
|
@ -199,6 +199,7 @@
|
|||
<string name="refresh_caldav_calendars">Refresh CalDAV calendars</string>
|
||||
<string name="refreshing">Refreshing…</string>
|
||||
<string name="refreshing_complete">Refreshing complete</string>
|
||||
<string name="editing_calendar_failed">Editing calendar failed</string>
|
||||
|
||||
<plurals name="by_minutes">
|
||||
<item quantity="one">%1$d minute</item>
|
||||
|
|
|
@ -199,6 +199,7 @@
|
|||
<string name="refresh_caldav_calendars">Refresh CalDAV calendars</string>
|
||||
<string name="refreshing">Refreshing…</string>
|
||||
<string name="refreshing_complete">Refreshing complete</string>
|
||||
<string name="editing_calendar_failed">Editing calendar failed</string>
|
||||
|
||||
<plurals name="by_minutes">
|
||||
<item quantity="one">%1$d minute</item>
|
||||
|
|
|
@ -199,6 +199,7 @@
|
|||
<string name="refresh_caldav_calendars">CalDAV 캘린더들 새로고침</string>
|
||||
<string name="refreshing">새로고침 중…</string>
|
||||
<string name="refreshing_complete">새로고침 완료</string>
|
||||
<string name="editing_calendar_failed">Editing calendar failed</string>
|
||||
|
||||
<plurals name="by_minutes">
|
||||
<item quantity="one">%1$d 분</item>
|
||||
|
|
|
@ -204,6 +204,7 @@
|
|||
<string name="refresh_caldav_calendars">Refresh CalDAV calendars</string>
|
||||
<string name="refreshing">Refreshing…</string>
|
||||
<string name="refreshing_complete">Refreshing complete</string>
|
||||
<string name="editing_calendar_failed">Editing calendar failed</string>
|
||||
|
||||
<plurals name="by_minutes">
|
||||
<item quantity="one">%1$d minutę</item>
|
||||
|
|
|
@ -199,6 +199,7 @@
|
|||
<string name="refresh_caldav_calendars">Refresh CalDAV calendars</string>
|
||||
<string name="refreshing">Refreshing…</string>
|
||||
<string name="refreshing_complete">Refreshing complete</string>
|
||||
<string name="editing_calendar_failed">Editing calendar failed</string>
|
||||
|
||||
<plurals name="by_minutes">
|
||||
<item quantity="one">%1$d minute</item>
|
||||
|
|
|
@ -199,6 +199,7 @@
|
|||
<string name="refresh_caldav_calendars">Refresh CalDAV calendars</string>
|
||||
<string name="refreshing">Refreshing…</string>
|
||||
<string name="refreshing_complete">Refreshing complete</string>
|
||||
<string name="editing_calendar_failed">Editing calendar failed</string>
|
||||
|
||||
<plurals name="by_minutes">
|
||||
<item quantity="one">%1$d minuto</item>
|
||||
|
|
|
@ -213,6 +213,7 @@
|
|||
<string name="refresh_caldav_calendars">Refresh CalDAV calendars</string>
|
||||
<string name="refreshing">Refreshing…</string>
|
||||
<string name="refreshing_complete">Refreshing complete</string>
|
||||
<string name="editing_calendar_failed">Editing calendar failed</string>
|
||||
|
||||
<plurals name="by_minutes">
|
||||
<item quantity="one">%1$d минута</item>
|
||||
|
|
|
@ -206,6 +206,7 @@
|
|||
<string name="refresh_caldav_calendars">Obnoviť CalDAV kalendáre</string>
|
||||
<string name="refreshing">Obnovuje sa…</string>
|
||||
<string name="refreshing_complete">Obnovovanie ukončené</string>
|
||||
<string name="editing_calendar_failed">Úprava kalendára zlyhala</string>
|
||||
|
||||
<plurals name="by_minutes">
|
||||
<item quantity="one">%1$d minútu</item>
|
||||
|
|
|
@ -199,6 +199,7 @@
|
|||
<string name="refresh_caldav_calendars">Refresh CalDAV calendars</string>
|
||||
<string name="refreshing">Refreshing…</string>
|
||||
<string name="refreshing_complete">Refreshing complete</string>
|
||||
<string name="editing_calendar_failed">Editing calendar failed</string>
|
||||
|
||||
<plurals name="by_minutes">
|
||||
<item quantity="one">%1$d minut</item>
|
||||
|
|
|
@ -199,6 +199,7 @@
|
|||
<string name="refresh_caldav_calendars">Refresh CalDAV calendars</string>
|
||||
<string name="refreshing">Refreshing…</string>
|
||||
<string name="refreshing_complete">Refreshing complete</string>
|
||||
<string name="editing_calendar_failed">Editing calendar failed</string>
|
||||
|
||||
<plurals name="by_minutes">
|
||||
<item quantity="one">%1$d minute</item>
|
||||
|
|
|
@ -199,6 +199,7 @@
|
|||
<string name="refresh_caldav_calendars">Refresh CalDAV calendars</string>
|
||||
<string name="refreshing">Refreshing…</string>
|
||||
<string name="refreshing_complete">Refreshing complete</string>
|
||||
<string name="editing_calendar_failed">Editing calendar failed</string>
|
||||
|
||||
<plurals name="by_minutes">
|
||||
<item quantity="one">%1$d minute</item>
|
||||
|
|
Loading…
Reference in a new issue