file-store: log miss store files better

This commit is contained in:
Marcin Kuzminski 2019-09-03 14:21:28 +02:00
parent 745a1f1278
commit e95b32fc0d
2 changed files with 6 additions and 1 deletions

View file

@ -91,6 +91,9 @@ class LocalFileStorage(object):
self.base_path = base_path
self.extensions = resolve_extensions([], groups=extension_groups)
def __repr__(self):
return '{}@{}'.format(self.__class__, self.base_path)
def store_path(self, filename):
"""
Returns absolute file path of the filename, joined to the

View file

@ -106,7 +106,9 @@ class FileStoreView(BaseAppView):
log.debug('Requesting FID:%s from store %s', file_uid, self.storage)
if not self.storage.exists(file_uid):
log.debug('File with FID:%s not found in the store', file_uid)
store_path = self.storage.store_path(file_uid)
log.debug('File with FID:%s not found in the store under `%s`',
file_uid, store_path)
raise HTTPNotFound()
db_obj = FileStore().query().filter(FileStore.file_uid == file_uid).scalar()