Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Fix "active" workspace CRUD HTTP status codes #666

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/codegate/api/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ async def activate_workspace(request: v1_models.ActivateWorkspaceRequest, status
try:
await wscrud.activate_workspace(request.name)
except crud.WorkspaceAlreadyActiveError:
return HTTPException(status_code=409, detail="Workspace already active")
raise HTTPException(status_code=409, detail="Workspace already active")
except crud.WorkspaceDoesNotExistError:
return HTTPException(status_code=404, detail="Workspace does not exist")
raise HTTPException(status_code=404, detail="Workspace does not exist")
except Exception:
return HTTPException(status_code=500, detail="Internal server error")
raise HTTPException(status_code=500, detail="Internal server error")

return Response(status_code=204)

Expand Down
Loading