Merge pull request #300 from yi-jiayu/upload-file-response-parameters
Include ResponseParameters in UploadFile errorbot-api-6.1
commit
fe3a0a8654
6
bot.go
6
bot.go
|
@ -245,7 +245,11 @@ func (bot *BotAPI) UploadFile(endpoint string, params map[string]string, fieldna
|
|||
}
|
||||
|
||||
if !apiResp.Ok {
|
||||
return APIResponse{}, errors.New(apiResp.Description)
|
||||
parameters := ResponseParameters{}
|
||||
if apiResp.Parameters != nil {
|
||||
parameters = *apiResp.Parameters
|
||||
}
|
||||
return apiResp, Error{Code: apiResp.ErrorCode, Message: apiResp.Description, ResponseParameters: parameters}
|
||||
}
|
||||
|
||||
return apiResp, nil
|
||||
|
|
Loading…
Reference in New Issue