Skip to content

Commit 133e254

Browse files
[PR #11234/a83597fa backport][3.12] Document exceptions raised by send_frame et al. (#11262)
**This is a backport of PR #11234 as merged into master (a83597f).** Co-authored-by: Jonathan Ehwald <[email protected]>
1 parent 4ad78b3 commit 133e254

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

CHANGES/11234.doc.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Clarified exceptions raised by ``WebSocketResponse.send_frame`` at al.
2+
-- by :user:`DoctorJohn`.

docs/web_reference.rst

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,9 @@ and :ref:`aiohttp-web-signals` handlers::
11181118
:class:`str` (converted to *UTF-8* encoded bytes)
11191119
or :class:`bytes`.
11201120

1121-
:raise RuntimeError: if connections is not started or closing.
1121+
:raise RuntimeError: if the connections is not started.
1122+
1123+
:raise aiohttp.ClientConnectionResetError: if the connection is closing.
11221124

11231125
.. versionchanged:: 3.0
11241126

@@ -1133,7 +1135,9 @@ and :ref:`aiohttp-web-signals` handlers::
11331135
:class:`str` (converted to *UTF-8* encoded bytes)
11341136
or :class:`bytes`.
11351137

1136-
:raise RuntimeError: if connections is not started or closing.
1138+
:raise RuntimeError: if the connections is not started.
1139+
1140+
:raise aiohttp.ClientConnectionResetError: if the connection is closing.
11371141

11381142
.. versionchanged:: 3.0
11391143

@@ -1150,10 +1154,12 @@ and :ref:`aiohttp-web-signals` handlers::
11501154
single message,
11511155
``None`` for not overriding per-socket setting.
11521156

1153-
:raise RuntimeError: if connection is not started or closing
1157+
:raise RuntimeError: if the connection is not started.
11541158

11551159
:raise TypeError: if data is not :class:`str`
11561160

1161+
:raise aiohttp.ClientConnectionResetError: if the connection is closing.
1162+
11571163
.. versionchanged:: 3.0
11581164

11591165
The method is converted into :term:`coroutine`,
@@ -1170,11 +1176,13 @@ and :ref:`aiohttp-web-signals` handlers::
11701176
single message,
11711177
``None`` for not overriding per-socket setting.
11721178

1173-
:raise RuntimeError: if connection is not started or closing
1179+
:raise RuntimeError: if the connection is not started.
11741180

11751181
:raise TypeError: if data is not :class:`bytes`,
11761182
:class:`bytearray` or :class:`memoryview`.
11771183

1184+
:raise aiohttp.ClientConnectionResetError: if the connection is closing.
1185+
11781186
.. versionchanged:: 3.0
11791187

11801188
The method is converted into :term:`coroutine`,
@@ -1195,12 +1203,14 @@ and :ref:`aiohttp-web-signals` handlers::
11951203
returns a JSON string
11961204
(:func:`json.dumps` by default).
11971205

1198-
:raise RuntimeError: if connection is not started or closing
1206+
:raise RuntimeError: if the connection is not started.
11991207

12001208
:raise ValueError: if data is not serializable object
12011209

12021210
:raise TypeError: if value returned by ``dumps`` param is not :class:`str`
12031211

1212+
:raise aiohttp.ClientConnectionResetError: if the connection is closing.
1213+
12041214
.. versionchanged:: 3.0
12051215

12061216
The method is converted into :term:`coroutine`,
@@ -1230,6 +1240,10 @@ and :ref:`aiohttp-web-signals` handlers::
12301240
single message,
12311241
``None`` for not overriding per-socket setting.
12321242

1243+
:raise RuntimeError: if the connection is not started.
1244+
1245+
:raise aiohttp.ClientConnectionResetError: if the connection is closing.
1246+
12331247
.. versionadded:: 3.11
12341248

12351249
.. method:: close(*, code=WSCloseCode.OK, message=b'', drain=True)

0 commit comments

Comments
 (0)