diff --git a/lib/Tumblr/API/RequestException.php b/lib/Tumblr/API/RequestException.php index 00af04b..0af7312 100644 --- a/lib/Tumblr/API/RequestException.php +++ b/lib/Tumblr/API/RequestException.php @@ -16,7 +16,11 @@ public function __construct($response) if (isset($error->meta)) { $errstr = $error->meta->msg; if (isset($error->response->errors)) { - $errstr .= ' ('.$error->response->errors[0].')'; + if (is_array($error->response->errors) && count($error->response->errors)) { + $errstr .= ' ('.$error->response->errors[0].')'; + } else if (is_object($error->response->errors) && property_exists($error->response->errors, 'state')) { + $errstr .= ' ('.$error->response->errors->state.')'; + } } } elseif (isset($error->response->errors)) { $errstr = $error->response->errors[0];