diff --git a/restclient.php b/restclient.php index 3756d40..d98845c 100755 --- a/restclient.php +++ b/restclient.php @@ -243,8 +243,7 @@ public function parse_response($response) : void { public function get_response_format() : string { if(!$this->response) - throw new RestClientException( - "A response must exist before it can be decoded."); + throw new RestClientException($this->error); // User-defined format. if(!empty($this->options['format']))