Skip to content

Commit

Permalink
Merge pull request #3 from mikedfunk/patch-1
Browse files Browse the repository at this point in the history
Handle change to json error format
  • Loading branch information
oceanapplications authored Feb 18, 2017
2 parents 05e2db2 + 7405f88 commit 96b0638
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ protected function request($endpoint, $params)
$rsp = json_decode($json, true);

if (array_key_exists('error', $rsp)) {
throw new \InvalidArgumentException($rsp['error']);
$error = $rsp['error'];
throw new \InvalidArgumentException($error['info'], $error['code']);
}

return $rsp;
Expand Down

0 comments on commit 96b0638

Please sign in to comment.