Srabasti commented on code in PR #32847:
URL: https://github.com/apache/airflow/pull/32847#discussion_r1285079360


##########
airflow/providers/google/cloud/hooks/dataflow.py:
##########
@@ -1014,8 +1014,9 @@ def start_sql_job(
         self.log.info("Output: %s", proc.stdout.decode())
         self.log.warning("Stderr: %s", proc.stderr.decode())
         self.log.info("Exit code %d", proc.returncode)
+        stderr_last_20_lines = 
"\n".join(proc.stderr.decode().strip().splitlines()[-20:])
         if proc.returncode != 0:
-            raise AirflowException(f"Process exit with non-zero exit code. 
Exit code: {proc.returncode}")
+            raise AirflowException(f"Process exit with non-zero exit code. 
Exit code: \ {proc.returncode} \n Error Details : {stderr_last_20_lines}")

Review Comment:
   Thanks for your reply @hussein-awala ! 
   The purpose of displaying the last 20 lines of the code in the exception is 
so that it is descriptive and one does not have to go through all the logs to 
figure out the root cause of the issue.
   Looks to me that the exception still would not have the error details from 
above snippet. Please let me know if I misunderstood your approach.



-- 
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