summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRolf Timmermans <rolftimmermans@voormedia.com>2017-05-04 12:42:50 +0200
committerRolf Timmermans <rolftimmermans@voormedia.com>2017-05-04 12:42:50 +0200
commitaa72a4c5af776655189fcaaa1d9733ea4b757cfd (patch)
tree453c9620a40d3ed2aa770774a5ee05c7eddbc277
parent59efb9b251af8fad28e3c1aef4b20416c8119c19 (diff)
downloadtinify-php-aa72a4c5af776655189fcaaa1d9733ea4b757cfd.zip
tinify-php-aa72a4c5af776655189fcaaa1d9733ea4b757cfd.tar.gz
tinify-php-aa72a4c5af776655189fcaaa1d9733ea4b757cfd.tar.bz2
Expose status properly.
-rw-r--r--lib/Tinify/Exception.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Tinify/Exception.php b/lib/Tinify/Exception.php
index 1fc49de..d88bdef 100644
--- a/lib/Tinify/Exception.php
+++ b/lib/Tinify/Exception.php
@@ -3,6 +3,8 @@
namespace Tinify;
class Exception extends \Exception {
+ public $status;
+
public static function create($message, $type, $status) {
if ($status == 401 || $status == 429) {
$klass = "Tinify\AccountException";
@@ -19,8 +21,8 @@ class Exception extends \Exception {
}
function __construct($message, $type = NULL, $status = NULL) {
+ $this->status = $status;
if ($status) {
- $this->status = $status;
parent::__construct($message . " (HTTP " . $status . "/" . $type . ")");
} else {
parent::__construct($message);