restructure: move backend into backend/

This commit is contained in:
2026-07-31 23:53:50 +05:00
parent 9074e55a13
commit 79bc04aaa7
29 changed files with 0 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
from fastapi import Request
from fastapi.responses import JSONResponse
class APIError(Exception):
"""Application error that maps to a JSON response with a status code."""
def __init__(self, status_code: int, detail: str):
self.status_code = status_code
self.detail = detail
super().__init__(detail)
async def api_error_handler(request: Request, exc: APIError) -> JSONResponse:
return JSONResponse(status_code=exc.status_code, content={"detail": exc.detail})