Also log the image id when an error occurs while generating thumbnails

This makes it easier to locate problematic images
This commit is contained in:
Roland Geider
2026-01-30 16:28:35 +01:00
parent 0953eb62d5
commit f8922a5b0c

View File

@@ -304,9 +304,14 @@ def search(request):
try:
thumbnail = t.get_thumbnail(aliases.get('micro_cropped')).url
except InvalidImageFormatError as e:
logger.warning(f'InvalidImageFormatError while processing a thumbnail: {e}')
logger.warning(
f'InvalidImageFormatError while processing thumbnails for '
f'image ID {image_obj.id}: {e}'
)
except OSError as e:
logger.warning(f'OSError while processing a thumbnail: {e}')
logger.warning(
f'OSError while processing thumbnails for image ID {image_obj.id}: {e}'
)
result_json = {
'value': translation.name,