From 1ad3283b9910266b8a97b4285b847e99d8ac256f Mon Sep 17 00:00:00 2001 From: adrianAzoitei Date: Mon, 6 Jan 2025 15:42:19 +0100 Subject: [PATCH] fix: account for None in error field of http response --- trino/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trino/client.py b/trino/client.py index da5e4047..62a7059a 100644 --- a/trino/client.py +++ b/trino/client.py @@ -621,7 +621,7 @@ def process(self, http_response) -> TrinoStatus: http_response.encoding = "utf-8" response = http_response.json() - if "error" in response: + if "error" in response and response["error"]: raise self._process_error(response["error"], response.get("id")) if constants.HEADER_CLEAR_SESSION in http_response.headers: