Skip to content

Commit 3632cbe

Browse files
authored
Merge pull request ArjanCodes#2 from 05rs/issue_1_fix
Issue 1: raised exception
2 parents 8964fde + ce31f91 commit 3632cbe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

2_creating_get_route_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def index() -> dict[str, dict[int, Item]]:
3737
@app.get("/items/{item_id}")
3838
def query_item_by_id(item_id: int) -> Item:
3939
if item_id not in items:
40-
HTTPException(status_code=404, detail=f"Item with {item_id=} does not exist.")
40+
raise HTTPException(status_code=404, detail=f"Item with {item_id=} does not exist.")
4141

4242
return items[item_id]
4343

0 commit comments

Comments
 (0)