Return APIResponse even with error in MakeRequest, closes #66.
parent
d74d1f3472
commit
80bdd621f7
2
bot.go
2
bot.go
|
@ -81,7 +81,7 @@ func (bot *BotAPI) MakeRequest(endpoint string, params url.Values) (APIResponse,
|
||||||
json.Unmarshal(bytes, &apiResp)
|
json.Unmarshal(bytes, &apiResp)
|
||||||
|
|
||||||
if !apiResp.Ok {
|
if !apiResp.Ok {
|
||||||
return APIResponse{}, errors.New(apiResp.Description)
|
return apiResp, errors.New(apiResp.Description)
|
||||||
}
|
}
|
||||||
|
|
||||||
return apiResp, nil
|
return apiResp, nil
|
||||||
|
|
Loading…
Reference in New Issue