# RuntimeError: No response returned.

- **ID:** `python/starlette-no-response-returned`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A middleware or endpoint returned None instead of a Response, or an exception was swallowed without a response.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 0.30.x | active | — | — |
| 0.36.x | active | — | — |

## Workarounds

1. **** (92% success)
   ```
   async def mw(request, call_next):\n    try:\n        return await call_next(request)\n    except Exception:\n        return JSONResponse({'err': 'x'}, status_code=500)
   ```
2. **** (95% success)
   ```
   @app.get('/')\nasync def r():\n    return JSONResponse({})
   ```

## Dead Ends

- **** — Swallowing exceptions leaves no response; error persists. (90% fail)
- **** — Raises the original error but does not produce a Response. (60% fail)
