Skip to content

Commit 98d8518

Browse files
committed
fix: use random string as exception id instead of python object id
1 parent 1a68ec2 commit 98d8518

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

airflow-core/src/airflow/api_fastapi/common/exceptions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from sqlalchemy.exc import IntegrityError
2828

2929
from airflow.configuration import conf
30+
from airflow.utils.strings import get_random_string
3031

3132
T = TypeVar("T", bound=Exception)
3233

@@ -67,7 +68,7 @@ def __init__(self):
6768
def exception_handler(self, request: Request, exc: IntegrityError, exc_id: str | None = None):
6869
"""Handle IntegrityError exception."""
6970
if self._is_dialect_matched(exc):
70-
exception_id = hex(id(exc)) if exc_id is None else exc_id
71+
exception_id = get_random_string() if exc_id is None else exc_id
7172
stacktrace = ""
7273
for tb in traceback.format_tb(exc.__traceback__):
7374
stacktrace += tb

0 commit comments

Comments
 (0)