Skip to content

Commit b07c410

Browse files
authored
Fixed status addressing between async and sync (#326)
1 parent e030193 commit b07c410

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

azure-kusto-data/azure/kusto/data/aio/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ async def _execute(
8585
response_text = await response.text()
8686
except Exception:
8787
response_text = None
88-
self._handle_http_error(e, endpoint, payload, response, response_json, response_text)
88+
self._handle_http_error(e, endpoint, payload, response, response.status, response_json, response_text)
8989

9090
return self._kusto_parse_by_endpoint(endpoint, response_json)

azure-kusto-data/azure/kusto/data/client.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -675,10 +675,11 @@ def _handle_http_error(
675675
endpoint: Optional[str],
676676
payload: Optional[io.IOBase],
677677
response: "Union[Response, aiohttp.ClientResponse]",
678+
status: int,
678679
response_json: Any,
679680
response_text: Optional[str],
680681
) -> NoReturn:
681-
if response.status_code == 404:
682+
if status == 404:
682683
if payload:
683684
raise KustoServiceError("The ingestion endpoint does not exist. Please enable streaming ingestion on your cluster.", response) from exception
684685

@@ -872,6 +873,6 @@ def _execute(
872873
response_json = response.json()
873874
response.raise_for_status()
874875
except Exception as e:
875-
self._handle_http_error(e, endpoint, payload, response, response_json, response.text)
876+
self._handle_http_error(e, endpoint, payload, response, response.status_code, response_json, response.text)
876877

877878
return self._kusto_parse_by_endpoint(endpoint, response_json)

0 commit comments

Comments
 (0)