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:
parent
ace97fadec
commit
60e88efa94
1 changed files with 5 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue