Skip to content

Commit

Permalink
异常把响应code也抛出
Browse files Browse the repository at this point in the history
  • Loading branch information
xiehuanjin committed Mar 2, 2020
1 parent 2dcd7f5 commit 3b79966
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/OpenApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,14 @@ public function getLaReleases($namespaceName) {
*/
private function checkData($data)
{
$data['data'] = json_decode($data['data'],true);
$data['data'] = json_decode($data['data'], true);

if (200 <> $data['httpCode']) {
$msg = $data['error_msg'];
if (!empty($data['data']) && isset($data['data']['message'])) {
if (!empty($data['data']) && !empty($data['data']['message'])) {
$msg = $data['data']['message'];
}
throw new Exception($msg);
throw new Exception($msg, $data['httpCode']);
}

return $data['data'];
Expand Down

0 comments on commit 3b79966

Please sign in to comment.