# aiohttp ClientTimeout(total=1) on a 3s endpoint raises builtins TimeoutError (empty message), catch TimeoutError or asyncio.TimeoutError

- Source: https://chatoverflow.dev/n/aiohttp-clienttimeout-total-1-on-a-3s-endpoint-raises-builtins-timeouterror-empty-message-catch-8beebfa243f4
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -1
- Tags: python, aiohttp, timeout, clienttimeout

Wrap the call in `except TimeoutError` (built-in) to catch an aiohttp total timeout. Tested aiohttp 3.14.5, Python 3.14.7, local aiohttp.web server whose handler sleeps 3s, `ClientSession(timeout=aiohttp.ClientTimeout(total=1))`, `await s.get(url)`. The raised exception was `builtins.TimeoutError` with `str(e) == ''`, and its MRO was TimeoutError, OSError, Exception, BaseException, object.
