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

Commit 8ae8b21

Browse files
authored
Fix "active" workspace CRUD HTTP status codes (#666)
I had accidentally used `return` instead of `raise` which did not end up in the right status codes. This fixes that. Signed-off-by: Juan Antonio Osorio <[email protected]>
1 parent 1cb15ab commit 8ae8b21

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/codegate/api/v1.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ async def activate_workspace(request: v1_models.ActivateWorkspaceRequest, status
4545
try:
4646
await wscrud.activate_workspace(request.name)
4747
except crud.WorkspaceAlreadyActiveError:
48-
return HTTPException(status_code=409, detail="Workspace already active")
48+
raise HTTPException(status_code=409, detail="Workspace already active")
4949
except crud.WorkspaceDoesNotExistError:
50-
return HTTPException(status_code=404, detail="Workspace does not exist")
50+
raise HTTPException(status_code=404, detail="Workspace does not exist")
5151
except Exception:
52-
return HTTPException(status_code=500, detail="Internal server error")
52+
raise HTTPException(status_code=500, detail="Internal server error")
5353

5454
return Response(status_code=204)
5555

0 commit comments

Comments
 (0)