potiuk commented on code in PR #51509:
URL: https://github.com/apache/airflow/pull/51509#discussion_r2134217750


##########
airflow-core/src/airflow/api_fastapi/common/exceptions.py:
##########
@@ -61,12 +64,20 @@ def __init__(self):
     def exception_handler(self, request: Request, exc: IntegrityError):
         """Handle IntegrityError exception."""
         if self._is_dialect_matched(exc):
+            if conf.get("api", "expose_stacktrace") == "True":
+                stacktrace = ""
+                for tb in traceback.format_tb(exc.__traceback__):
+                    stacktrace += tb
+            else:
+                stacktrace = "Database Integrity Error - Check logs for more 
details."

Review Comment:
   Just generate a random hexadecimal hash (something that can be copy&pasted) 
and add it to both -  the regular log printed and to the message sent back as 
error to the client. 



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to