include exception in warning message

This commit is contained in:
Sam Mason 2023-07-07 13:36:26 +01:00
parent 05c3646058
commit 0568292553
No known key found for this signature in database
GPG Key ID: 0D059A3A7ECA31DA

View File

@ -519,7 +519,7 @@ def _encode_ipython_image(image, image_format):
try:
image.save(b, image_format)
except Exception as e:
warnings.warn(f"failed to encode image as {image_format}")
warnings.warn(f"failed to encode image as {image_format}: {e}")
return None
return b.getvalue()