# aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://example.com/nonexistent')

- **ID:** `python/aiohttp-client-http-error`
- **Domain:** python
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The server returns a 4xx or 5xx status code, and aiohttp raises an exception if raise_for_status is called.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.7 | active | — | — |
| 3.8 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   if resp.status != 200: raise Exception(f'HTTP {resp.status}')
   ```
2. **** (90% success)
   ```
   try: resp.raise_for_status() except aiohttp.ClientResponseError as e: print(e.status)
   ```

## Dead Ends

- **** — The error is raised by raise_for_status(); if you don't call it, no exception occurs. (60% fail)
- **** — The resource doesn't exist; changing method won't help. (80% fail)
