mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-08 14:42:26 +08:00
fix(media): fixed not return common error
fixed not return common error
This commit is contained in:
@@ -192,10 +192,9 @@ func (r *Client) GetTempFile(mediaID string) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 检查响应是否为错误信息
|
// 检查响应是否为错误信息
|
||||||
errorResponse := &util.CommonError{}
|
err = util.DecodeWithCommonError(response, "GetTempFile")
|
||||||
err = util.DecodeWithError(response, errorResponse, "GetTempFile")
|
if err != nil {
|
||||||
if err == nil && errorResponse.ErrCode != 0 {
|
return nil, err
|
||||||
return nil, fmt.Errorf("GetTempFile error: %d, %s", errorResponse.ErrCode, errorResponse.ErrMsg)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果不是错误响应,则返回原始数据
|
// 如果不是错误响应,则返回原始数据
|
||||||
|
|||||||
Reference in New Issue
Block a user