init, add/delete/edit vlans and devices

This commit is contained in:
2026-07-31 21:04:41 +05:00
commit eccda2b26d
28 changed files with 1487 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})