Skip to content

Commit

Permalink
Merge pull request borgbackup#8420 from ThomasWaldmann/catch-be-error
Browse files Browse the repository at this point in the history
catch BackendError raised by Store(), see borgbackup#8373
  • Loading branch information
ThomasWaldmann authored Sep 26, 2024
2 parents 5be2485 + 628990d commit 8461538
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ Compatibility notes:
- or, if the command makes sense for an arbitrary amount of archives, archives
can be selected using a glob pattern, like:

- borg delete -a 'sh:myarchive-2024-*'
- borg recreate -a 'sh:myarchive-2024-*'
- borg delete -a 'sh:myarchive-2024-??-??'
- borg recreate -a 'sh:myarchive-2024-??-??'
- some borg 1.x commands that supported working on a repo AND on an archive
were split into 2 commands, some others were renamed:

Expand Down
6 changes: 5 additions & 1 deletion src/borg/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from borgstore.store import Store
from borgstore.store import ObjectNotFound as StoreObjectNotFound
from borgstore.backends.errors import BackendError as StoreBackendError
from borgstore.backends.errors import BackendDoesNotExist as StoreBackendDoesNotExist

from .checksums import xxh64
Expand Down Expand Up @@ -116,7 +117,10 @@ def __init__(
location = Location(url)
self._location = location
# use a Store with flat config storage and 2-levels-nested data storage
self.store = Store(url, levels={"config/": [0], "data/": [2]})
try:
self.store = Store(url, levels={"config/": [0], "data/": [2]})
except StoreBackendError as e:
raise Error(str(e))
self.version = None
# long-running repository methods which emit log or progress output are responsible for calling
# the ._send_log method periodically to get log and progress output transferred to the borg client
Expand Down

0 comments on commit 8461538

Please sign in to comment.