fehlerbehandlung verbessert
This commit is contained in:
+12
-7
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""
|
||||||
ics_mail_importer_env_v4.py
|
ics_mail_importer_env_v5.py
|
||||||
---------------------------
|
---------------------------
|
||||||
ICS-Importer für mailbox.org / CalDAV.
|
ICS-Importer für mailbox.org / CalDAV.
|
||||||
|
|
||||||
@@ -54,12 +54,17 @@ def env_bool(name: str, default: str = "false") -> bool:
|
|||||||
|
|
||||||
|
|
||||||
def is_newer_version_conflict(exc: Exception) -> bool:
|
def is_newer_version_conflict(exc: Exception) -> bool:
|
||||||
message = str(exc)
|
message = str(exc or "").lower()
|
||||||
return (
|
patterns = [
|
||||||
"412 Precondition Failed" in message
|
"412 precondition failed",
|
||||||
and "CAL-4121" in message
|
"cal-4121",
|
||||||
and "newer version of the appointment already exists" in message
|
"newer version of the appointment already exists",
|
||||||
)
|
"concurrent modification",
|
||||||
|
"client sequence",
|
||||||
|
"actual sequence",
|
||||||
|
]
|
||||||
|
matches = sum(1 for p in patterns if p in message)
|
||||||
|
return matches >= 2
|
||||||
|
|
||||||
|
|
||||||
def import_ics_to_caldav(ics_bytes: bytes, uid_hash: str):
|
def import_ics_to_caldav(ics_bytes: bytes, uid_hash: str):
|
||||||
|
|||||||
Reference in New Issue
Block a user