FastAPI - Error Handling
Why does this custom validation error handler fail to catch errors?
```python
from fastapi import FastAPI
from fastapi.exceptions import ValidationError
from fastapi.responses import JSONResponse
app = FastAPI()
@app.exception_handler(ValidationError)
async def custom_handler(request, exc):
return JSONResponse(status_code=422, content={'detail': 'Custom error'})
```
