Skip to content

Commit

Permalink
Fix for error without type or message.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcoonen committed Mar 7, 2016
1 parent dd4b983 commit 608b7b1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Provider/Mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ protected function checkResponse (ResponseInterface $response, $data)
{
if (isset($data['error']))
{
$message = sprintf('[%s] %s', $data['error']['type'], $data['error']['message']);
if (isset($data['error']['type']) && isset($data['error']['message'])) {
$message = sprintf('[%s] %s', $data['error']['type'], $data['error']['message']);
} else {
$message = $data['error'];
}

if (isset($data['error']['field']))
{
Expand Down

0 comments on commit 608b7b1

Please sign in to comment.