1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-26 07:14:31 +02:00

Chain Imagick exceptions instead of hiding.

If Imagick throws while reading the file, the original exception
is hidden and a new one is thrown instead. This PR passes the
original exception along in the $previous parameter, so you can
figure out what exactly went wrong under the hood 😎
This commit is contained in:
René Kooi
2016-01-09 22:58:04 +01:00
parent 9f29360b8a
commit 623c84b70d

View File

@@ -23,7 +23,9 @@ class Decoder extends \Intervention\Image\AbstractDecoder
} catch (\ImagickException $e) { } catch (\ImagickException $e) {
throw new \Intervention\Image\Exception\NotReadableException( throw new \Intervention\Image\Exception\NotReadableException(
"Unable to read image from path ({$path})." "Unable to read image from path ({$path}).",
0,
$e
); );
} }
@@ -81,7 +83,9 @@ class Decoder extends \Intervention\Image\AbstractDecoder
} catch (\ImagickException $e) { } catch (\ImagickException $e) {
throw new \Intervention\Image\Exception\NotReadableException( throw new \Intervention\Image\Exception\NotReadableException(
"Unable to read image from binary data." "Unable to read image from binary data.",
0,
$e
); );
} }