fix: update HTTP status code from UNPROCESSABLE_ENTITY to UNPROCESSABLE_CONTENT

This commit is contained in:
Abhimanyu Saharan
2026-02-15 16:06:06 +05:30
parent 24731667d4
commit b702ade0cc
15 changed files with 52 additions and 52 deletions

View File

@@ -28,7 +28,7 @@ def gateway_client_config(gateway: Gateway) -> GatewayClientConfig:
url = (gateway.url or "").strip()
if not url:
raise HTTPException(
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
detail="Gateway url is required",
)
token = (gateway.token or "").strip() or None
@@ -51,7 +51,7 @@ def require_gateway_workspace_root(gateway: Gateway) -> str:
workspace_root = (gateway.workspace_root or "").strip()
if not workspace_root:
raise HTTPException(
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
detail="Gateway workspace_root is required",
)
return workspace_root
@@ -82,13 +82,13 @@ async def require_gateway_for_board(
"""Return a board's gateway or raise a 422 with a stable error message."""
if board.gateway_id is None:
raise HTTPException(
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
detail="Board gateway_id is required",
)
gateway = await get_gateway_for_board(session, board)
if gateway is None:
raise HTTPException(
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
detail="Board gateway_id is invalid",
)
if require_workspace_root: