# werkzeug.exceptions.NotFound: 404 Not Found

- **ID:** `python/flask-abort-http-exception`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The abort(404) function is called, but the error handler is not properly set up to return a custom response.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   Register an error handler: @app.errorhandler(404) def not_found(e): return jsonify(error='Not Found'), 404
   ```
2. **** (90% success)
   ```
   Use abort(404, description="Custom message") and handle it in the handler.
   ```

## Dead Ends

- **** — This masks the error and gives incorrect status codes. (80% fail)
- **** — This is not suitable for APIs that need JSON responses. (70% fail)
