Skip to content

Commit

Permalink
Fix atoi error. (#110)
Browse files Browse the repository at this point in the history
* the result can return just Data field, so we parse a code as an error only if it is set as an error.
  • Loading branch information
mtoader authored and rajsigma committed Sep 8, 2023
1 parent 6934d94 commit 3c103ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,9 @@ func (sc *snowflakeConn) rowsForRunningQuery(
}
return err
}
if !resp.Success {
// the result response sometimes contains only Data and not anything else. We parse the error code only
// if it's set in the response
if !resp.Success && resp.Code != "" {
message := resp.Message
code, err := strconv.Atoi(resp.Code)
if err != nil {
Expand Down

0 comments on commit 3c103ab

Please sign in to comment.