Skip to content

Commit f3a3897

Browse files
committed
Rewrite exception messages for methods in AbstractDecoder
1 parent bbf0f9f commit f3a3897

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Drivers/Gd/Decoders/AbstractDecoder.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ protected function getMediaTypeByFilePath(string $filepath): MediaType
2323
$info = @getimagesize($filepath);
2424

2525
if (!is_array($info)) {
26-
throw new DecoderException('Unable to decode input');
26+
throw new DecoderException('Unable to detect media (MIME) from data in file path.');
2727
}
2828

2929
if (!array_key_exists('mime', $info)) {
30-
throw new DecoderException('Unable to decode input');
30+
throw new DecoderException('Unable to detect media (MIME) from data in file path.');
3131
}
3232

3333
return MediaType::from($info['mime']);
@@ -45,11 +45,11 @@ protected function getMediaTypeByBinary(string $data): MediaType
4545
$info = @getimagesizefromstring($data);
4646

4747
if (!is_array($info)) {
48-
throw new DecoderException('Unable to decode input');
48+
throw new DecoderException('Unable to detect media (MIME) from binary data.');
4949
}
5050

5151
if (!array_key_exists('mime', $info)) {
52-
throw new DecoderException('Unable to decode input');
52+
throw new DecoderException('Unable to detect media (MIME) from binary data.');
5353
}
5454

5555
return MediaType::from($info['mime']);

0 commit comments

Comments
 (0)