From fccd266e2bb014582831d2125b050ee2c0e929c0 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Thu, 16 Jun 2022 17:34:33 +0530 Subject: reading error responses from API --- user/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user/user.go') diff --git a/user/user.go b/user/user.go index 9f31284..704fed7 100644 --- a/user/user.go +++ b/user/user.go @@ -35,7 +35,7 @@ func (c Client) GetSelfUserInfo() (UserInfo, error) { json.Unmarshal([]byte(data), &userData) json.Unmarshal([]byte(data), &errMessage) - if errMessage.Err != nil { + if errMessage.Err != "" { return userData, errors.New(errMessage.Err + " " + errMessage.Msg) } -- cgit v1.2.3