mirror of
https://github.com/wger-project/wger.git
synced 2026-02-18 00:17:51 +01:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user