1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-01-03 05:35:58 +00:00

repository: catch store backend exception, re-raise as repo exception

This commit is contained in:
Thomas Waldmann 2024-09-01 20:50:36 +02:00
parent ace97fadec
commit 60e88efa94
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01

View file

@ -3,6 +3,7 @@
from borgstore.store import Store
from borgstore.store import ObjectNotFound as StoreObjectNotFound
from borgstore.backends.errors import BackendDoesNotExist as StoreBackendDoesNotExist
from .checksums import xxh64
from .constants import * # NOQA
@ -177,7 +178,10 @@ def destroy(self):
def open(self, *, exclusive, lock_wait=None, lock=True):
assert lock_wait is not None
self.store.open()
try:
self.store.open()
except StoreBackendDoesNotExist:
raise self.DoesNotExist(str(self._location)) from None
if lock:
self.lock = Lock(self.store, exclusive, timeout=lock_wait).acquire()
else: