Skip to content

Commit 2413d54

Browse files
committed
feat(app): register global exception handlers in FastAPI
Update main.py to setup exception handlers during app initialization: - Import setup_exception_handlers from error_handlers module - Call setup_exception_handlers(app) after middleware setup Part of Issue #7: Error Handling & Resilience
1 parent f423697 commit 2413d54

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

app/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from app import __version__
1313
from app.config import get_settings
14+
from app.error_handlers import setup_exception_handlers
1415
from app.logging_config import configure_logging, get_logger
1516
from app.middleware import setup_middleware
1617
from app.routes import router
@@ -158,6 +159,9 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
158159
# Setup middleware
159160
setup_middleware(app, cors_origins=settings.api.cors_origins_list)
160161

162+
# Setup exception handlers (Phase 2.3: Error Handling & Resilience)
163+
setup_exception_handlers(app)
164+
161165
# Setup rate limiting (Phase 2.2: Security Implementation)
162166
setup_rate_limiting(app)
163167

0 commit comments

Comments
 (0)