o-nikolas commented on code in PR #27174:
URL: https://github.com/apache/airflow/pull/27174#discussion_r1002208194


##########
airflow/providers/apache/druid/hooks/druid.py:
##########
@@ -89,7 +89,8 @@ def submit_indexing_job(self, json_index_spec: dict[str, Any] 
| str) -> None:
         self.log.info("Druid ingestion spec: %s", json_index_spec)
         req_index = requests.post(url, data=json_index_spec, 
headers=self.header, auth=self.get_auth())
         if req_index.status_code != 200:
-            raise AirflowException(f'Did not get 200 when submitting the Druid 
job to {url}')
+            raise AirflowException(f'The error code of {url}: 
{req_index.content}')

Review Comment:
   I find the wording here a little misleading, you're not actually logging a 
satus code, but rather the response body which contains the error message and 
traces. Maybe something like:
   
   ```suggestion
               raise AirflowException(f'Failed when submitting the Druid job to 
{url}. Status code: {req_index.status_code}, response: {req_index.content}')
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to