INNER CODE UNIT · Python

fatal_exit

caipe-io/ai-platform-engineering · ai_platform_engineering/dynamic_agents/src/dynamic_agents/main.py:17

def fatal_exit(message: str) -> None:
    """Log a critical error and forcefully terminate the process.

    Uses os._exit(1) to bypass exception handlers and ensure immediate termination,
    which is necessary when running under uvicorn with reload mode.
    """
    logger.critical(message)
    os._exit(1)


# ruff: noqa: E402
# Imports must be after logging setup to ensure our format is used
from fastapi import FastAPI, Request
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse

from dynamic_agents.config import get_settings
from dynamic_agents.metrics import PrometheusHTTPMiddleware

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…