From f3a38975dba6323e14eb6ac79d689abe74208a81 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Wed, 26 Jun 2024 17:38:27 +0200 Subject: [PATCH] Rewrite exception messages for methods in AbstractDecoder --- src/Drivers/Gd/Decoders/AbstractDecoder.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Drivers/Gd/Decoders/AbstractDecoder.php b/src/Drivers/Gd/Decoders/AbstractDecoder.php index 11781f779..0ad9f1104 100644 --- a/src/Drivers/Gd/Decoders/AbstractDecoder.php +++ b/src/Drivers/Gd/Decoders/AbstractDecoder.php @@ -23,11 +23,11 @@ protected function getMediaTypeByFilePath(string $filepath): MediaType $info = @getimagesize($filepath); if (!is_array($info)) { - throw new DecoderException('Unable to decode input'); + throw new DecoderException('Unable to detect media (MIME) from data in file path.'); } if (!array_key_exists('mime', $info)) { - throw new DecoderException('Unable to decode input'); + throw new DecoderException('Unable to detect media (MIME) from data in file path.'); } return MediaType::from($info['mime']); @@ -45,11 +45,11 @@ protected function getMediaTypeByBinary(string $data): MediaType $info = @getimagesizefromstring($data); if (!is_array($info)) { - throw new DecoderException('Unable to decode input'); + throw new DecoderException('Unable to detect media (MIME) from binary data.'); } if (!array_key_exists('mime', $info)) { - throw new DecoderException('Unable to decode input'); + throw new DecoderException('Unable to detect media (MIME) from binary data.'); } return MediaType::from($info['mime']);