From 4524bfd5be7278aab894df45416a5c49055b9a0c Mon Sep 17 00:00:00 2001 From: Lasse Rafn Date: Tue, 12 Jun 2018 10:51:49 +0200 Subject: [PATCH] Update Exchange.php Fixed ResponseExpection params. Fixer.io error response format: [ "success" => false "error" => array:2 [ "code" => 105 "type" => "base_currency_access_restricted" ] ] --- src/Exchange.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.'); }