gosnowflake icon indicating copy to clipboard operation
gosnowflake copied to clipboard

SNOW-559970: Add error cast check for SnowflakeError

Open satishbhor opened this issue 2 years ago • 1 comments

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

satishbhor avatar Mar 15 '22 11:03 satishbhor

Hello Team, Any update on this?

satishbhor avatar Aug 11 '22 04:08 satishbhor

#771

sfc-gh-dszmolka avatar Apr 12 '23 06:04 sfc-gh-dszmolka

Hello @satishbhor ! Thanks for your input, this is very valuable. Can you rebase and solve conflicts?

sfc-gh-pfus avatar Oct 17 '23 08:10 sfc-gh-pfus

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!

sfc-gh-pfus avatar Oct 27 '23 12:10 sfc-gh-pfus