Passing error code
parent
ec221ba9ea
commit
016d6acdf3
2
bot.go
2
bot.go
|
@ -84,7 +84,7 @@ func (bot *BotAPI) MakeRequest(endpoint string, params url.Values) (APIResponse,
|
||||||
if apiResp.Parameters != nil {
|
if apiResp.Parameters != nil {
|
||||||
parameters = *apiResp.Parameters
|
parameters = *apiResp.Parameters
|
||||||
}
|
}
|
||||||
return apiResp, Error{apiResp.Description, parameters}
|
return apiResp, Error{Code: apiResp.ErrorCode, Message: apiResp.Description, ResponseParameters: parameters}
|
||||||
}
|
}
|
||||||
|
|
||||||
return apiResp, nil
|
return apiResp, nil
|
||||||
|
|
1
types.go
1
types.go
|
@ -897,6 +897,7 @@ type PreCheckoutQuery struct {
|
||||||
|
|
||||||
// Error is an error containing extra information returned by the Telegram API.
|
// Error is an error containing extra information returned by the Telegram API.
|
||||||
type Error struct {
|
type Error struct {
|
||||||
|
Code int
|
||||||
Message string
|
Message string
|
||||||
ResponseParameters
|
ResponseParameters
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue