diff --git a/2_creating_get_route_query.py b/2_creating_get_route_query.py index c5b015a..e5fc01d 100644 --- a/2_creating_get_route_query.py +++ b/2_creating_get_route_query.py @@ -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]