Skip to content

Commit d716d01

Browse files
Up to date with trino-connection-error
1 parent 1f5cdff commit d716d01

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

trino/client.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,11 @@ def execute(self, additional_http_headers=None) -> TrinoResult:
787787
if self.cancelled:
788788
raise exceptions.TrinoUserError("Query has been cancelled", self.query_id)
789789

790-
response = self._request.post(self._query, additional_http_headers)
790+
try:
791+
response = self._request.post(self._query, additional_http_headers)
792+
except requests.exceptions.RequestException as e:
793+
raise trino.exceptions.TrinoConnectionError("failed to execute: {}".format(e))
794+
791795
status = self._request.process(response)
792796
self._info_uri = status.info_uri
793797
self._query_id = status.id

0 commit comments

Comments
 (0)