Skip to content

Commit

Permalink
Fix, update, and improve client exceptions documentation (aio-libs#7733)
Browse files Browse the repository at this point in the history
## What do these changes do?

In the *Hierarchy of exceptions* section of the *Client Reference*
documentation:
- Fix `ServerConnectionError` indentation, denoting that it subclasses
`ClientConnectionError`, not `ClientOSError`
- Fix `ServerFingerprintMismatch` indentation, denoting that it
subclasses `ServerConnectionError`, not `ClientOSError`
- Normalize the formatting so as to consistently use two, rather than
three, spaces for indentation
- Normalize the formatting so as to consistently include a blank newline
between exceptions
- Order exceptions alphabetically
- Add `TooManyRedirects`
- Add `UnixClientConnectorError`

Also order the documentation of client exceptions alphabetically by
hierarchy
  • Loading branch information
Harmon758 authored Oct 20, 2023
1 parent a7bc5e9 commit 3b68b2f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 34 deletions.
1 change: 1 addition & 0 deletions CHANGES/7733.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix, update, and improve client exceptions documentation.
75 changes: 41 additions & 34 deletions docs/client_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2138,13 +2138,6 @@ Response errors
.. deprecated:: 3.1


.. class:: WSServerHandshakeError

Web socket server response error.

Derived from :exc:`ClientResponseError`


.. class:: ContentTypeError

Invalid content type.
Expand All @@ -2165,6 +2158,13 @@ Response errors

.. versionadded:: 3.2


.. class:: WSServerHandshakeError

Web socket server response error.

Derived from :exc:`ClientResponseError`

Connection errors
^^^^^^^^^^^^^^^^^

Expand All @@ -2191,14 +2191,6 @@ Connection errors

Derived from :exc:`ClientConnectorError`

.. class:: UnixClientConnectorError

Derived from :exc:`ClientConnectorError`

.. class:: ServerConnectionError

Derived from :exc:`ClientConnectionError`

.. class:: ClientSSLError

Derived from :exc:`ClientConnectorError`
Expand All @@ -2215,6 +2207,14 @@ Connection errors

Derived from :exc:`ClientSSLError` and :exc:`ssl.CertificateError`

.. class:: UnixClientConnectorError

Derived from :exc:`ClientConnectorError`

.. class:: ServerConnectionError

Derived from :exc:`ClientConnectionError`

.. class:: ServerDisconnectedError

Server disconnected.
Expand All @@ -2226,51 +2226,58 @@ Connection errors
Partially parsed HTTP message (optional).


.. class:: ServerTimeoutError

Server operation timeout: read timeout, etc.

Derived from :exc:`ServerConnectionError` and :exc:`asyncio.TimeoutError`

.. class:: ServerFingerprintMismatch

Server fingerprint mismatch.

Derived from :exc:`ServerConnectionError`

.. class:: ServerTimeoutError

Server operation timeout: read timeout, etc.

Derived from :exc:`ServerConnectionError` and :exc:`asyncio.TimeoutError`


Hierarchy of exceptions
^^^^^^^^^^^^^^^^^^^^^^^

* :exc:`ClientError`

* :exc:`ClientResponseError`

* :exc:`ContentTypeError`
* :exc:`WSServerHandshakeError`
* :exc:`~aiohttp.ClientHttpProxyError`

* :exc:`ClientConnectionError`

* :exc:`ClientOSError`

* :exc:`ClientConnectorError`

* :exc:`ClientSSLError`
* :exc:`ClientProxyConnectionError`

* :exc:`ClientSSLError`

* :exc:`ClientConnectorCertificateError`
* :exc:`ClientConnectorCertificateError`

* :exc:`ClientConnectorSSLError`
* :exc:`ClientConnectorSSLError`

* :exc:`ClientProxyConnectionError`
* :exc:`UnixClientConnectorError`

* :exc:`ServerConnectionError`
* :exc:`ServerConnectionError`

* :exc:`ServerDisconnectedError`
* :exc:`ServerTimeoutError`
* :exc:`ServerDisconnectedError`

* :exc:`ServerFingerprintMismatch`

* :exc:`ServerTimeoutError`

* :exc:`ClientPayloadError`

* :exc:`ClientResponseError`

* :exc:`~aiohttp.ClientHttpProxyError`

* :exc:`ContentTypeError`

* :exc:`TooManyRedirects`

* :exc:`WSServerHandshakeError`

* :exc:`InvalidURL`

0 comments on commit 3b68b2f

Please sign in to comment.