Skip to content

Commit 4d22a8e

Browse files
author
Phan Thanh Cong
committed
handle transload error
1 parent 6ebe063 commit 4d22a8e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Plugins/Imgur.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ protected function doTransload()
8484
$this->throwException('%s: Image format not supported, or image is corrupt.', __METHOD__);
8585
}
8686

87+
if (isset($result['data']['error'])) {
88+
$this->throwException('%s: %s (%s).',
89+
__METHOD__, $result['data']['error']['message'], $result['data']['error']['type']
90+
);
91+
}
92+
8793
return 'http://i.imgur.com/' . $result['data']['hash'] . $this->getExtensionFormImage($this->url);
8894
}
8995

0 commit comments

Comments
 (0)