Skip to content

Commit

Permalink
Update FixerIo.php
Browse files Browse the repository at this point in the history
  • Loading branch information
otherguy authored Jun 17, 2019
1 parent 2e6dafa commit 990715b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Drivers/FixerIo.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,14 @@ function apiRequest(string $endpoint, array $params = [], string $method = 'GET'

// Handle response exceptions.
if ($response['success'] == false) {
$message = "[{$response['error']['type']}]";
$message = '';
if (isset($response['error']['type'])) {
$message = "[{$response['error']['type']}]";
}
if (isset($response['error']['info'])) {
$message .= ' ' . $response['error']['info'];
}
throw new ApiException($message, $response['error']['code']);
throw new ApiException(trim($message), $response['error']['code']);
}

return $response;
Expand Down

0 comments on commit 990715b

Please sign in to comment.