Raise NoClosestPhotoDB when FileNotFound.

master
voussoir 2022-09-07 18:06:50 -07:00
parent 57d311569f
commit 219b1ca5bb
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
1 changed files with 11 additions and 6 deletions

View File

@ -1638,12 +1638,17 @@ class PhotoDB(
path = possible
log.debug('Found closest PhotoDB at "%s".', path.absolute_path)
photodb = cls(
data_directory=path,
create=False,
*args,
**kwargs,
)
try:
photodb = cls(
data_directory=path,
create=False,
*args,
**kwargs,
)
except FileNotFoundError:
raise exceptions.NoClosestPhotoDB(starting.absolute_path)
return photodb
def __del__(self):