gosnowflake
gosnowflake copied to clipboard
SNOW-559970: Add error cast check for SnowflakeError
checkQueryStatus API not always returns SnowflakeError, e.g. if context is cancelled by client then it may return *errors.errorString, Hence we should have check whether its SnowflakeError or not, otherwise it will panic and will crash app.
Checklist
- [X] Code compiles correctly
- [X] Run
make fmt
to fix inconsistent formats - [x] Run
make lint
to get lint errors and fix all of them - [x] Created tests which fail without the change (if possible)
- [x] All tests passing
- [ ] Extended the README / documentation, if necessary
Hello Team, Any update on this?
#771
Hello @satishbhor ! Thanks for your input, this is very valuable. Can you rebase and solve conflicts?
I noticed, that the only place in which we use casting to snowflakeError
was already fixed (as @sfc-gh-dszmolka kindly suggested). So I think that we don't need a dedicated function for casting to snowflakeError
.
In that case I'm going to close this PR, but personally I'm always happy if community suggests improvements. Thank you very much! I hope, that in some time you will provide another improvement or a bug fix!