Skip to content

Commit

Permalink
Merge pull request #1 from creacoon/master
Browse files Browse the repository at this point in the history
Small fix for errors without type or a message.
  • Loading branch information
ricardodevries committed Mar 29, 2016
2 parents af90e69 + 608b7b1 commit 104ac93
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 104ac93

Please sign in to comment.