This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 15f330eeef Better error message for internal api call error (#37852)
15f330eeef is described below

commit 15f330eeef1867556909bc9f748ec8aa6a6a4793
Author: Daniel Standish <[email protected]>
AuthorDate: Sat Mar 2 21:52:36 2024 -0800

    Better error message for internal api call error (#37852)
    
    Previously would not show the real reason, just e.g. 400:BAD REQUEST
---
 airflow/api_internal/internal_api_call.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/airflow/api_internal/internal_api_call.py 
b/airflow/api_internal/internal_api_call.py
index dff6a6e375..80d44cabf3 100644
--- a/airflow/api_internal/internal_api_call.py
+++ b/airflow/api_internal/internal_api_call.py
@@ -103,7 +103,8 @@ def internal_api_call(func: Callable[PS, RT]) -> 
Callable[PS, RT]:
         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
 

Reply via email to