INNER CODE UNIT · Python

global_exception_handler

ai-infra-curriculum/ai-infra-engineer-learning · projects/project-103-llm-deployment/src/api/main.py:518

async def global_exception_handler(request, exc):
    """
    Global exception handler.

    TODO: Implement error handling:
    1. Log error with context
    2. Track error metrics
    3. Return user-friendly error
    4. Hide sensitive information
    """
    logger.error(f"Unhandled exception: {exc}", exc_info=True)
    return HTTPException(status_code=500, detail="Internal server error")


# ============================================================================
# Application Entry Point
# ============================================================================

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…