FastAPI - Error Handling
Identify the error in this FastAPI code snippet:
```python
from fastapi import FastAPI, HTTPException
app = FastAPI()
@app.get("/users/{user_id}")
async def get_user(user_id: int):
try:
if user_id < 0:
raise HTTPException(status_code=400, detail="Negative ID")
except HTTPException:
return {"error": "Invalid user ID"}
```
