Skip to content

Commit

Permalink
check request error
Browse files Browse the repository at this point in the history
  • Loading branch information
Sagleft committed Feb 19, 2022
1 parent 25bf5eb commit d72fe87
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions request.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ func (c *UtopiaClient) queryResultToString(methodName string, params map[string]
return "", errors.New("client disconected")
}
response, err := c.apiQuery(methodName, params)
if err != nil {
return "", errors.New("failed to send API request: " + err.Error())
}
if result, ok := response["result"]; ok {
resultstr := fmt.Sprintf("%v", result)
return resultstr, err
Expand Down

0 comments on commit d72fe87

Please sign in to comment.