Improve exception message in ImageUtil::createWebpVariant()
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 11 Jul 2022 09:57:11 +0000 (11:57 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 11 Jul 2022 09:57:11 +0000 (11:57 +0200)
wcfsetup/install/files/lib/util/ImageUtil.class.php

index 4749d88382dfa0b7b021835e082bc62616cbb325..5e54c83f5ca4a7433d417e9005e2d1dc16d87770 100644 (file)
@@ -250,7 +250,10 @@ final class ImageUtil
                 break;
 
             default:
-                throw new \InvalidArgumentException("Unsupported image format, expecting one of 'gif', 'jpg', 'png' or 'webp'.");
+                throw new \InvalidArgumentException(\sprintf(
+                    "Unsupported image format '%s', expecting one of 'gif', 'jpg', 'png' or 'webp'.",
+                    $extension
+                ));
         }
 
         $imageAdapter = ImageHandler::getInstance()->getAdapter();