This commit is contained in:
HotSwapp
2025-08-18 20:20:04 -05:00
parent 89b2bc0aa2
commit bac8cc4bd5
114 changed files with 30258 additions and 1341 deletions

View File

@@ -101,13 +101,21 @@ async def http_exception_handler(request: Request, exc: HTTPException) -> JSONRe
detail=message,
path=request.url.path,
)
return _build_error_response(
response = _build_error_response(
request,
status_code=exc.status_code,
message=message,
code="http_error",
details=None,
)
# Preserve any headers set on the HTTPException (e.g., WWW-Authenticate)
try:
if getattr(exc, "headers", None):
for key, value in exc.headers.items():
response.headers[key] = value
except Exception:
pass
return response
async def validation_exception_handler(request: Request, exc: RequestValidationError) -> JSONResponse: