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 committed Dec 29, 2022
1 parent ff7d6b9 commit 0e7543d
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 @@ -411,7 +411,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 0e7543d

Please sign in to comment.