Skip to content

Commit

Permalink
Merge pull request #2 from DerJacques/patch-1
Browse files Browse the repository at this point in the history
Handle failed requests that do not contain errors
  • Loading branch information
RBech authored Sep 28, 2017
2 parents 92be641 + df9a661 commit 3189823
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Economic.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,13 @@ private function isSuccessful($response, $formattedResponse, $timeout)

if (isset($formattedResponse->message)) {
$this->lastError = sprintf('%d: %s', $formattedResponse->httpStatusCode, $formattedResponse->message);
$this->errors = $formattedResponse->errors;

if (isset($formattedResponse->errors)) {
$this->errors = $formattedResponse->errors;
}
return false;
}

return false;
}
}
}

0 comments on commit 3189823

Please sign in to comment.