Skip to content

Commit

Permalink
Up to date with trino-connection-error
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaheer-rossoneri14 committed Aug 23, 2023
1 parent 1f5cdff commit d716d01
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion trino/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,11 @@ def execute(self, additional_http_headers=None) -> TrinoResult:
if self.cancelled:
raise exceptions.TrinoUserError("Query has been cancelled", self.query_id)

response = self._request.post(self._query, additional_http_headers)
try:
response = self._request.post(self._query, additional_http_headers)
except requests.exceptions.RequestException as e:
raise trino.exceptions.TrinoConnectionError("failed to execute: {}".format(e))

status = self._request.process(response)
self._info_uri = status.info_uri
self._query_id = status.id
Expand Down

0 comments on commit d716d01

Please sign in to comment.