Skip to content

Commit

Permalink
[Fix] SIG-18794: Fix handling of results response for canceled queries (
Browse files Browse the repository at this point in the history
  • Loading branch information
mtoader authored and madisonchamberlain committed Feb 8, 2023
1 parent fbac64f commit a94f204
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,20 @@ func (sc *snowflakeConn) rowsForRunningQuery(
}
return err
}
if !resp.Success {
message := resp.Message
code, err := strconv.Atoi(resp.Code)
if err != nil {
code = ErrQueryStatus
message = fmt.Sprintf("%s: (failed to parse original code: %s: %s)", message, resp.Code, err.Error())
}
return (&SnowflakeError{
Number: code,
SQLState: resp.Data.SQLState,
Message: message,
QueryID: resp.Data.QueryID,
}).exceptionTelemetry(sc)
}
rows.addDownloader(populateChunkDownloader(ctx, sc, resp.Data))
return nil
}
Expand Down

0 comments on commit a94f204

Please sign in to comment.