Log exception when retrieve file ID from the filestore for Binary field

This commit is contained in:
Cédric Krier
2025-12-15 17:11:51 +01:00
parent aefd12642a
commit ce7e973e85
+8 -1
View File
@@ -1,5 +1,8 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import logging
from sql import Column, Null
from trytond.filestore import filestore
@@ -8,6 +11,8 @@ from trytond.transaction import Transaction
from .field import Field
logger = logging.getLogger(__name__)
def caster(d):
if isinstance(d, bytes):
@@ -88,7 +93,9 @@ class Binary(Field):
try:
res[record_id] = store_func(file_id, prefix)
except (IOError, OSError):
pass
logger.exception(
"failed to retrieve %r from filestore at %r",
file_id, prefix)
for i in values:
if i['id'] in res: