aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-06-16 17:34:33 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-06-16 17:34:33 +0530
commitfccd266e2bb014582831d2125b050ee2c0e929c0 (patch)
treed007e6f3f638813139b09fa107d9ecb952c332ba
parentdfdd87d16bdb5aac867826d454964c063d6740b9 (diff)
reading error responses from API
-rw-r--r--user/user.go2
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)
}