chore: initial project scaffold and gitignore

This commit is contained in:
2026-04-03 07:33:32 +00:00
commit 3e3acbd13d
41 changed files with 3658 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
"""Exception types and FastAPI handlers."""
from fastapi import FastAPI, Request, status
from fastapi.responses import JSONResponse
class PortfolioHubError(Exception):
"""Base application exception."""
class FeatureNotReadyError(PortfolioHubError):
"""Raised when an endpoint contract exists but the implementation is pending."""
def register_exception_handlers(app: FastAPI) -> None:
@app.exception_handler(FeatureNotReadyError)
async def handle_not_ready(_: Request, exc: FeatureNotReadyError) -> JSONResponse:
return JSONResponse(
status_code=status.HTTP_501_NOT_IMPLEMENTED,
content={"detail": str(exc) or "Feature not implemented yet"},
)