Skip to content

Commit

Permalink
work around exception type issue in borg.remote
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasWaldmann committed Sep 23, 2024
1 parent b57aa46 commit c2436fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/borg/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -2105,7 +2105,8 @@ def finish(self):
self.manifest.chunks_index_id = None # invalidate all chunks index caches
try:
self.repository.store_delete("cache/chunks") # delete the now invalid chunks cache
except StoreObjectNotFound:
except (Repository.ObjectNotFound, StoreObjectNotFound):

Check warning on line 2108 in src/borg/archive.py

View check run for this annotation

Codecov / codecov/patch

src/borg/archive.py#L2108

Added line #L2108 was not covered by tests
# TODO: ^ seem like RemoteRepository raises Repository.ONF instead of StoreONF
pass

Check warning on line 2110 in src/borg/archive.py

View check run for this annotation

Codecov / codecov/patch

src/borg/archive.py#L2110

Added line #L2110 was not covered by tests
self.manifest.write()

Expand Down
3 changes: 2 additions & 1 deletion src/borg/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,8 @@ def build_chunkindex_from_repo(repository, manifest=None):
logger.debug(f"trying to get cached chunk index (id {bin_to_hex(wanted_ci_id or b'')}) from the repo...")
try:
chunks_data = repository.store_load("cache/chunks")
except StoreObjectNotFound:
except (Repository.ObjectNotFound, StoreObjectNotFound):
# TODO: ^ seem like RemoteRepository raises Repository.ONF instead of StoreONF
logger.debug("cache/chunks not found in the repository.")
else:
if xxh64(chunks_data) == manifest.chunks_index_id:
Expand Down

0 comments on commit c2436fb

Please sign in to comment.