yireo / Yireo_Webp2

Magento 2 module to add WebP support to Magento 2
Open Software License 3.0
194 stars 54 forks source link

Catch the correct exception when using properties of a specific exception #157

Closed CyberSecutor closed 9 months ago

CyberSecutor commented 9 months ago

This error is thrown occasionaly when the converter runs into an Exception. The original code catches the generic \Exception but the message generated there expects a description property that is only present in the ConversionFailedException.

[2023-09-26 report.CRITICAL: Exception: Warning: Undefined property: Exception::$description in ../vendor/yireo/magento2-webp2/Convertor/ConvertWrapper.php on line 55 in ..//vendor/magento/framework/App/ErrorHandler.php:62
Stack trace:
jissereitsma commented 9 months ago

Thanks for this fix. It will be included in the next release!