diff --git a/src/Exchange.php b/src/Exchange.php index 0f2e730..f43b45e 100644 --- a/src/Exchange.php +++ b/src/Exchange.php @@ -271,7 +271,7 @@ private function prepareResponse($body) if (isset($response['rates']) and is_array($response['rates'])) { return ($this->asObject) ? (object) $response['rates'] : $response['rates']; } else if (isset($response['error'])) { - throw new ResponseException($response['error']); + throw new ResponseException($response['error']['type'], $response['error']['code']); } else { throw new ResponseException('Response body is malformed.'); }