Handle missing Nextcloud folders gracefully (HTTP 404) (#50)

While syncing a Nextcloud source, a single missing folder currently aborts the entire sync process:

PROPFIND ... failed: HTTP 404

This can happen when:

a configured folder has been deleted or renamed;
a shared folder is no longer available;
permissions change between sync runs.

Proposed change:

Catch HTTPStatusError with status code 404 during folder traversal (_walk_folder).
Log a warning indicating that the folder was skipped.
Continue processing the remaining folders/files instead of failing the whole synchronization job.
This commit is contained in:
Mirko Ceroni 2026-07-17 21:28:27 +02:00 • committed by GitHub
parent 9f2f29a6e3
commit cf65912170
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -70,7 +70,14 @@ class _WebDAVClient:
return
seen_dirs.add(folder_path)
for entry in self._propfind(folder_path):
try:
children = self._propfind(folder_path)
except httpx.HTTPStatusError as exc:
if exc.response is not None and exc.response.status_code == 404:
return
raise
for entry in children:
if entry.path == folder_path:
continue
if entry.is_collection: