Skip to content

Commit

Permalink
Merge pull request #2 from 05rs/issue_1_fix
Browse files Browse the repository at this point in the history
Issue 1: raised exception
  • Loading branch information
egges authored Sep 26, 2023
2 parents 8964fde + ce31f91 commit 3632cbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 2_creating_get_route_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def index() -> dict[str, dict[int, Item]]:
@app.get("/items/{item_id}")
def query_item_by_id(item_id: int) -> Item:
if item_id not in items:
HTTPException(status_code=404, detail=f"Item with {item_id=} does not exist.")
raise HTTPException(status_code=404, detail=f"Item with {item_id=} does not exist.")

return items[item_id]

Expand Down

0 comments on commit 3632cbe

Please sign in to comment.