FastAPI - Error Handling
Find the bug in this FastAPI error handling code:
```python
from fastapi import FastAPI, HTTPException
app = FastAPI()
@app.get("/products/{product_id}")
async def get_product(product_id: int):
try:
if product_id == 0:
raise HTTPException(status_code=404, detail="Product not found")
except Exception as e:
return {"error": str(e)}
```
