Skip to content

Commit

Permalink
Passing error code
Browse files Browse the repository at this point in the history
  • Loading branch information
bcmk committed Mar 1, 2019
1 parent ec221ba commit 016d6ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (bot *BotAPI) MakeRequest(endpoint string, params url.Values) (APIResponse,
if apiResp.Parameters != nil {
parameters = *apiResp.Parameters
}
return apiResp, Error{apiResp.Description, parameters}
return apiResp, Error{Code: apiResp.ErrorCode, Message: apiResp.Description, ResponseParameters: parameters}
}

return apiResp, nil
Expand Down
1 change: 1 addition & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ type PreCheckoutQuery struct {

// Error is an error containing extra information returned by the Telegram API.
type Error struct {
Code int
Message string
ResponseParameters
}
Expand Down

0 comments on commit 016d6ac

Please sign in to comment.