diff --git a/request.go b/request.go index b64c2e6..9a89ad1 100644 --- a/request.go +++ b/request.go @@ -216,7 +216,10 @@ func (c *UtopiaClient) queryResultToInt(methodName string, params map[string]int return 0, err } result, err := strconv.ParseInt(resultstr, 10, 64) - return result, err + if err != nil { + return 0, fmt.Errorf("parse query result: %w", err) + } + return result, nil } func convertResult(response map[string]interface{}, toInterface interface{}) error { diff --git a/v2/internal/utopia/request.go b/v2/internal/utopia/request.go index 923b19b..04c6789 100644 --- a/v2/internal/utopia/request.go +++ b/v2/internal/utopia/request.go @@ -204,7 +204,10 @@ func (c *UtopiaClient) queryResultToInt( return 0, err } result, err := strconv.ParseInt(resultstr, 10, 64) - return result, err + if err != nil { + return 0, fmt.Errorf("parse query result: %w", err) + } + return result, nil } func convertResult(response map[string]interface{}, toInterface interface{}) error {