INNER CODE UNIT · Python

integrity_error_handler

cqzyys/lang-agent · lang-agent-backend/lang_agent/main.py:102

    async def integrity_error_handler(request: Request, exc: IntegrityError):
        logger.error(exc.detail)
        return JSONResponse(
            status_code=409,
            content=ApiResponse(
                success=False,
                error=error_to_str(exc),
                status_code=409,
            ).model_dump(),
        )

    @app.exception_handler(DatabaseError)
    async def database_error_handler(request: Request, exc: DatabaseError):
        logger.error(exc.detail)
        return JSONResponse(
            status_code=500,
            content=ApiResponse(
                success=False,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…