Skip to content

Commit 800360a

Browse files
[PR #12042/a52e149c backport][3.14] docs: Document asyncio.TimeoutError for WebSocketResponse.receive methods (#12087)
**This is a backport of PR #12042 as merged into master (a52e149).** Co-authored-by: Varun Chawla <[email protected]>
1 parent 367d8d1 commit 800360a

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

CHANGES/12042.doc.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Documented :exc:`asyncio.TimeoutError` for ``WebSocketResponse.receive()``
2+
and related methods -- by :user:`veeceey`.

docs/web_reference.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,8 @@ and :ref:`aiohttp-web-signals` handlers::
13061306

13071307
:raise RuntimeError: if connection is not started
13081308

1309+
:raise asyncio.TimeoutError: if timeout expires before receiving a message
1310+
13091311
.. method:: receive_str(*, timeout=None)
13101312
:async:
13111313

@@ -1324,6 +1326,8 @@ and :ref:`aiohttp-web-signals` handlers::
13241326

13251327
:raise aiohttp.WSMessageTypeError: if message is not :const:`~aiohttp.WSMsgType.TEXT`.
13261328

1329+
:raise asyncio.TimeoutError: if timeout expires before receiving a message
1330+
13271331
.. method:: receive_bytes(*, timeout=None)
13281332
:async:
13291333

@@ -1343,6 +1347,8 @@ and :ref:`aiohttp-web-signals` handlers::
13431347

13441348
:raise aiohttp.WSMessageTypeError: if message is not :const:`~aiohttp.WSMsgType.BINARY`.
13451349

1350+
:raise asyncio.TimeoutError: if timeout expires before receiving a message
1351+
13461352
.. method:: receive_json(*, loads=json.loads, timeout=None)
13471353
:async:
13481354

@@ -1366,6 +1372,7 @@ and :ref:`aiohttp-web-signals` handlers::
13661372

13671373
:raise TypeError: if message is :const:`~aiohttp.WSMsgType.BINARY`.
13681374
:raise ValueError: if message is not valid JSON.
1375+
:raise asyncio.TimeoutError: if timeout expires before receiving a message
13691376

13701377

13711378
.. seealso:: :ref:`WebSockets handling<aiohttp-web-websockets>`

0 commit comments

Comments
 (0)