Skip to content

Commit 0f0b490

Browse files
Fix
1 parent 32757c9 commit 0f0b490

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/snowflake/connector/network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ def _request_exec_wrapper(
10341034
time.sleep(float(retry_ctx.current_sleep_time))
10351035
retry_ctx.increment()
10361036

1037-
reason = getattr(cause, "errno", 0)
1037+
reason = cause.errno if cause.errno is not None else 0
10381038
reason = (
10391039
reason - ER_HTTP_GENERAL_ERROR
10401040
if reason >= ER_HTTP_GENERAL_ERROR

test/integ/test_connection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
ER_NO_ACCOUNT_NAME,
3131
ER_NOT_IMPLICITY_SNOWFLAKE_DATATYPE,
3232
)
33-
from snowflake.connector.errors import Error, InterfaceError
33+
from snowflake.connector.errors import Error, HttpError
3434
from snowflake.connector.network import APPLICATION_SNOWSQL, ReauthenticationRequest
3535
from snowflake.connector.sqlstate import SQLSTATE_FEATURE_NOT_SUPPORTED
3636
from snowflake.connector.telemetry import TelemetryField
@@ -530,7 +530,7 @@ def exe(sql):
530530
@pytest.mark.timeout(15)
531531
@pytest.mark.skipolddriver
532532
def test_invalid_account_timeout():
533-
with pytest.raises(InterfaceError):
533+
with pytest.raises(HttpError):
534534
snowflake.connector.connect(
535535
account="bogus", user="test", password="test", login_timeout=5
536536
)
@@ -569,7 +569,7 @@ def test_eu_connection(tmpdir):
569569
import os
570570

571571
os.environ["SF_OCSP_RESPONSE_CACHE_SERVER_ENABLED"] = "true"
572-
with pytest.raises(InterfaceError):
572+
with pytest.raises(HttpError):
573573
# must reach Snowflake
574574
snowflake.connector.connect(
575575
account="testaccount1234",
@@ -593,7 +593,7 @@ def test_us_west_connection(tmpdir):
593593
Notes:
594594
Region is deprecated.
595595
"""
596-
with pytest.raises(InterfaceError):
596+
with pytest.raises(HttpError):
597597
# must reach Snowflake
598598
snowflake.connector.connect(
599599
account="testaccount1234",

0 commit comments

Comments
 (0)