diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-06-16 17:34:33 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-06-16 17:34:33 +0530 |
commit | fccd266e2bb014582831d2125b050ee2c0e929c0 (patch) | |
tree | d007e6f3f638813139b09fa107d9ecb952c332ba /user/user.go | |
parent | dfdd87d16bdb5aac867826d454964c063d6740b9 (diff) |
reading error responses from API
Diffstat (limited to 'user/user.go')
-rw-r--r-- | user/user.go | 2 |
1 files changed, 1 insertions, 1 deletions
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) } |