mirror of
https://github.com/langgenius/dify.git
synced 2026-11-10 21:35:45 +08:00
17 lines
458 B
Python
17 lines
458 B
Python
"""Database failures of the tracing repositories, reported as the tracing slice's error."""
|
|
|
|
from collections.abc import Generator
|
|
from contextlib import contextmanager
|
|
|
|
from sqlalchemy.exc import SQLAlchemyError
|
|
|
|
from services.tracing.errors import TracingStoreUnavailableError
|
|
|
|
|
|
@contextmanager
|
|
def tracing_store_errors() -> Generator[None]:
|
|
try:
|
|
yield
|
|
except SQLAlchemyError as error:
|
|
raise TracingStoreUnavailableError from error
|