Skip to content

Commit

Permalink
catch BackendError raised by Store(), see #8373
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasWaldmann committed Sep 25, 2024
1 parent 5be2485 commit c3038e1
Showing 1 changed file with 5 additions and 1 deletion.
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 c3038e1

Please sign in to comment.