Skip to content

Commit

Permalink
Merge pull request borgbackup#8477 from ThomasWaldmann/non-existing-r…
Browse files Browse the repository at this point in the history
…epo-errors

simple error msg for non-existing repo, fixes borgbackup#8475
  • Loading branch information
ThomasWaldmann authored Oct 16, 2024
2 parents dfbd3b7 + a49de25 commit b00ae89
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/borg/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ def open(self, *, exclusive, lock_wait=None, lock=True):
self.lock = Lock(self.store, exclusive, timeout=lock_wait).acquire()
else:
self.lock = None
readme = self.store.load("config/readme").decode()
try:
readme = self.store.load("config/readme").decode()
except StoreObjectNotFound:
raise self.DoesNotExist(str(self._location)) from None
if readme != REPOSITORY_README:
raise self.InvalidRepository(str(self._location))
self.version = int(self.store.load("config/version").decode())
Expand Down

0 comments on commit b00ae89

Please sign in to comment.