all repos — telegram-bot-api @ 87e7035a900c7cb1fd896e5f33b461c96c3ac31e

Golang bindings for the Telegram Bot API

Merge pull request #227 from bcmk/passing-error-code

Passing error code
Syfaro syfaro@huefox.com
Wed, 24 Apr 2019 04:32:50 -0500
commit

87e7035a900c7cb1fd896e5f33b461c96c3ac31e

parent

e305b7a1f5438ee21f50148be3d8c0302fcd05f7

2 files changed, 2 insertions(+), 1 deletions(-)

jump to
M bot.gobot.go

@@ -84,7 +84,7 @@ parameters := ResponseParameters{}

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
M types.gotypes.go

@@ -949,6 +949,7 @@ }

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