Skip to content

Commit

Permalink
修复阿里大鱼网关错误信息问题 (overtrue#40)
Browse files Browse the repository at this point in the history
* 修复阿里大鱼网关错误信息问题

* 修复代码格式

* 修复代码风格问题

* 修复代码风格问题

* 修复代码风格问题

* 修复代码风格问题
  • Loading branch information
hooklife authored and overtrue committed Jul 31, 2017
1 parent 7f26c0f commit 3e91765
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Gateways/AlidayuGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ public function send($to, MessageInterface $message, Config $config)
$result = $this->post(self::ENDPOINT_URL, $params);

if (!empty($result['error_response'])) {
throw new GatewayErrorException($result['error_response']['sub_msg'], $result['error_response']['code'], $result);
if (isset($result['error_response']['sub_msg'])) {
$message = $result['error_response']['sub_msg'];
} else {
$message = $result['error_response']['msg'];
}
throw new GatewayErrorException($message, $result['error_response']['code'], $result);
}

return $result;
Expand Down

0 comments on commit 3e91765

Please sign in to comment.