Raise NoClosestPhotoDB when FileNotFound.

This commit is contained in:
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

View file

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