From 623c84b70d7e1104f954825f1c5a96c2f0a64ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Kooi?= Date: Sat, 9 Jan 2016 22:58:04 +0100 Subject: [PATCH] Chain Imagick exceptions instead of hiding. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 😎 --- src/Intervention/Image/Imagick/Decoder.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Intervention/Image/Imagick/Decoder.php b/src/Intervention/Image/Imagick/Decoder.php index 6ef9d7b5..c54092a1 100644 --- a/src/Intervention/Image/Imagick/Decoder.php +++ b/src/Intervention/Image/Imagick/Decoder.php @@ -23,7 +23,9 @@ class Decoder extends \Intervention\Image\AbstractDecoder } catch (\ImagickException $e) { 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) { throw new \Intervention\Image\Exception\NotReadableException( - "Unable to read image from binary data." + "Unable to read image from binary data.", + 0, + $e ); }