SNOW-897499: Throw ReauthenticationRequest
error instead of ProgrammingError
#1705
Labels
ReauthenticationRequest
error instead of ProgrammingError
#1705
What is the current behavior?
Currently if
ReauthenticationRequest
gets raised, it gets caught by the library and insteadProgrammingError
gets raised.network.py
Both errors would be captured in logs, but there's no way to determine in code if the error is caused by reauthentication request.
What is the desired behavior?
Desired behaviour is either raising
ProgrammingError
but like this:raise ex.cause from ex
. Or throwReauthenticationRequest
error instead.How would this improve
snowflake-connector-python
?This would allow users to catch
ReauthenticationRequest
separately fromProgrammingError
and have a different logic to handle one or the other.References and other background
I have this code for running queries in Snowflake.
But unfortunately this code fails when
ProgrammingError
gets raised. I can see that most of the timesProgrammingError
gets raised in situations when recreating connection would not help. However, it's not the case when it gets raised because ofReauthenticationRequest
. To handle this I need to do the following:This code is not very stable because it relies on the message in the error.
The text was updated successfully, but these errors were encountered: