diff --git a/src/backends/webdav/WebDAVSource.cpp b/src/backends/webdav/WebDAVSource.cpp index 301ad88a..b1d6debd 100644 --- a/src/backends/webdav/WebDAVSource.cpp +++ b/src/backends/webdav/WebDAVSource.cpp @@ -1501,8 +1501,19 @@ void WebDAVSource::removeItem(const string &uid) // TODO: match exactly the expected revision, aka ETag, // or implement locking. // req.addHeader("If-Match", etag); - if (req->run()) { - break; + try { + if (req->run()) { + break; + } + } catch (const TransportStatusException &ex) { + if (ex.syncMLStatus() == 412) { + // Radicale reports 412 'Precondition Failed'. Hmm, okay. + // Let's map it to the expected 404. + SE_THROW_EXCEPTION_STATUS(TransportStatusException, + "object not found (was 412 'Precondition Failed')", + SyncMLStatus(404)); + } + throw; } } SE_LOG_DEBUG(NULL, NULL, "remove item status: %s",