File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ def __init__(
4040 self .session_configuration = session_configuration
4141 self .catalog = catalog
4242 self .schema = schema
43+ self .http_path = http_path
4344
4445 try :
4546 self .auth_provider = get_python_sql_connector_auth_provider (
@@ -108,11 +109,23 @@ def __init__(
108109 self .protocol_version = None
109110
110111 def open (self ):
111- self ._session_id = self .backend .open_session (
112- session_configuration = self .session_configuration ,
113- catalog = self .catalog ,
114- schema = self .schema ,
115- )
112+ try :
113+ self ._session_id = self .backend .open_session (
114+ session_configuration = self .session_configuration ,
115+ catalog = self .catalog ,
116+ schema = self .schema ,
117+ )
118+ except Exception as e :
119+ TelemetryClientFactory .connection_failure_log (
120+ error_name = "Exception" ,
121+ error_message = str (e ),
122+ host_url = self .host ,
123+ http_path = self .http_path ,
124+ port = self .port ,
125+ user_agent = self .useragent_header ,
126+ )
127+ raise e
128+
116129 self .protocol_version = self .get_protocol_version (self ._session_id )
117130 self .is_open = True
118131 logger .info ("Successfully opened session %s" , str (self .guid_hex ))
You can’t perform that action at this time.
0 commit comments