From cf415f82cdf5b77b21c3cc67671832e1fabd0a88 Mon Sep 17 00:00:00 2001 From: luigif Date: Thu, 3 May 2018 13:51:27 +0200 Subject: [PATCH] Corrected bug in prepareResponseResult $response['error'] is an array while we need a string to raise a ResponseException --- src/Exchange.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Exchange.php b/src/Exchange.php index 0f2e730..4fc4743 100644 --- a/src/Exchange.php +++ b/src/Exchange.php @@ -293,8 +293,8 @@ private function prepareResponseResult($body) new DateTime($response['date']), $response['rates'] ); - } else if (isset($response['error'])) { - throw new ResponseException($response['error']); + } else if (isset($response['error']['info'])) { + throw new ResponseException($response['error']['info']); } else { throw new ResponseException('Response body is malformed.'); }