fastapi_middleware_toolkit.error_handlers ========================================= .. py:module:: fastapi_middleware_toolkit.error_handlers .. autoapi-nested-parse:: Global error handling middleware for FastAPI applications. Extracted from GridFlow backend/src/middleware/error_handler.py Attributes ---------- .. autoapisummary:: fastapi_middleware_toolkit.error_handlers.logger Functions --------- .. autoapisummary:: fastapi_middleware_toolkit.error_handlers.setup_error_handlers Module Contents --------------- .. py:data:: logger .. py:function:: setup_error_handlers(app: fastapi.FastAPI, custom_exception_class: Optional[Type[Exception]] = None) -> None Setup global error handlers for the FastAPI application. Args: app: FastAPI application instance custom_exception_class: Optional custom exception class to handle Example: >>> from fastapi import FastAPI >>> from python_app_exceptions import BaseApplicationException >>> app = FastAPI() >>> setup_error_handlers(app, BaseApplicationException)