优化微信错误码

This commit is contained in:
JaguarJack
2020-06-21 16:20:02 +08:00
parent 73c7788218
commit 4392f25e97
2 changed files with 4 additions and 1 deletions

View File

@@ -66,7 +66,8 @@ class WeChat
public static function throw($response)
{
if (isset($response['errcode']) && $response['errcode']) {
throw new WechatResponseException(Errors::WECHAT[$response['errcode']], $response['errcode']);
$message = Errors::WECHAT[$response['errcode']] ?? $response['errcode'];
throw new WechatResponseException($message, $response['errcode']);
}
return $response;