Skip to content

Commit

Permalink
updated get_component error message from 404 to 422 (#374)
Browse files Browse the repository at this point in the history
Co-authored-by: Philip Meier <[email protected]>
  • Loading branch information
Tengal-Teemo and pmeier authored Mar 25, 2024
1 parent aa2a702 commit a5e4795
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ragna/deploy/_api/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def get_component(display_name: str) -> Component:
raise RagnaException(
"Unknown component",
display_name=display_name,
http_status_code=status.HTTP_404_NOT_FOUND,
http_status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
http_detail=RagnaException.MESSAGE,
)

Expand Down
2 changes: 1 addition & 1 deletion tests/deploy/api/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_unknown_component(tmp_local_root):
},
)

assert response.status_code == status.HTTP_404_NOT_FOUND
assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY

error = response.json()["error"]
assert "Unknown component" in error["message"]

0 comments on commit a5e4795

Please sign in to comment.