Skip to content

Commit

Permalink
Better error message for internal api call error (apache#37852)
Browse files Browse the repository at this point in the history
Previously would not show the real reason, just e.g. 400:BAD REQUEST
  • Loading branch information
dstandish authored and abhishekbhakat committed Mar 5, 2024
1 parent c30b4e2 commit f6f032b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion airflow/api_internal/internal_api_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def make_jsonrpc_request(method_name: str, params_json: str) -> bytes:
response = requests.post(url=internal_api_endpoint, data=json.dumps(data), headers=headers)
if response.status_code != 200:
raise AirflowException(
f"Got {response.status_code}:{response.reason} when sending the internal api request."
f"Got {response.status_code}:{response.reason} when sending "
f"the internal api request: {response.text}"
)
return response.content

Expand Down

0 comments on commit f6f032b

Please sign in to comment.