aboitreaud commented on PR #42017:
URL: https://github.com/apache/airflow/pull/42017#issuecomment-2348358162

   Hi @kacpermuda and @uranusjr and thanks for your comments!
   Good catch, and thanks for pointing that out! I hadn’t fully considered the 
possibility of an edge case where the last exception raised might not be the 
one we have here in the adapter. To address this, I’m reverting back to using 
`traceback.format_exception(error)` instead of relying on 
`traceback.format_exc()`. This ensures we are handling the correct exception in 
all cases.
   
   However, I don't think that joining on "\n" is necessary, here is of what 
the stack trace would look like:
   - the **old output**, by joining on "\\\n": 
   ```
   Traceback (most recent call last):
   \n  File "/Users/adrien.boitreaud/import traceback.py", line 6, in 
cause_error
       result = 1 / 0
   \nZeroDivisionError: division by zero
   ```
   -  by joining on "\n": 
   ```
   Traceback (most recent call last):
   
     File "/Users/adrien.boitreaud/import traceback.py", line 6, in cause_error
       result = 1 / 0
   
   ZeroDivisionError: division by zero
   ```
   - the **new output**, by joining on "":
   ```
   Traceback (most recent call last):
     File "/Users/adrien.boitreaud/import traceback.py", line 6, in cause_error
       result = 1 / 0
   ZeroDivisionError: division by zero
   ```


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