]> khamidou — GitHub mirrors - imapclient.git/commitdiff
Updated exceptions documentation for 1.0
authorMenno Smits <menno@freshfoo.com>
Tue, 17 Nov 2015 04:02:08 +0000 (17:02 +1300)
committerMenno Smits <menno@freshfoo.com>
Tue, 17 Nov 2015 04:02:08 +0000 (17:02 +1300)
doc/src/index.rst
doc/src/releases.rst

index 7be4e949ea2cb4df533eaa3eabc35202583d5ddb..28b962d1f248c9bbcd3175cfe461cb1ba2def5b4 100644 (file)
@@ -137,17 +137,6 @@ If *folder_encode* is True, all folder names returned by IMAPClient
 are always returned as unicode strings. If *folder_encode* is False,
 folder names are returned as str (Python 2) or bytes (Python 3).
 
-Exceptions
-~~~~~~~~~~
-The IMAP related exceptions that will be raised by this class are:
-
-* IMAPClient.Error
-* IMAPClient.AbortError
-* IMAPClient.ReadOnlyError
-
-These are aliases for the imaplib.IMAP4 exceptions of the same name. Socket
-errors may also be raised in the case of network errors.
-
 TLS/SSL
 ~~~~~~~
 IMAPClient uses sensible TLS parameter defaults for encrypted
@@ -206,6 +195,30 @@ Here's an example of how gevent_openssl can be used with IMAPClient::
 .. _gevent: http://www.gevent.org/
 .. _`gevent_openssl`: https://pypi.python.org/pypi/gevent_openssl/
 
+
+Exceptions
+~~~~~~~~~~
+The following exceptions may be raised by IMAPClient directly. They
+are attached to the IMAPClient class.
+
+* IMAPClient.Error: the base class for IMAPClient's exceptions and the
+  most commonly used error.
+* IMAPClient.AbortError: raised if a serious error has occurred that
+  means the IMAP connection is no longer usable. The connection should
+  be dropped without logout if this occurs.
+* IMAPClient.ReadOnlyError: raised if a modifying operation was
+  attempted on a read-only folder.
+
+Exceptions from lower network layers are also possible, in particular:
+
+* socket.error
+* socket.timeout: raised if a timeout was specified when creating the
+  IMAPClient instance and a network operation takes too long.
+* backports.ssl.SSLError: the base class for network or SSL protocol
+  errors when ssl=True or starttls() is used.
+* backports.ssl.CertificateError: raised when TLS certification
+  verification fails. This is *not* a subclass of SSLError.
+
 API Reference
 -------------
 
index 2e2077d09b8c7efe6f5daeaed5efbe46966651c5..0d81d8441e16c3838634b8472084423d1db72076 100644 (file)
@@ -34,6 +34,9 @@ Compatibility breaks:
    may fail now (especially if a self-signed certificate is used by
    the server). Refer to the documentation for details of how to
    supply alternate CA certificates or disable verification.
+4. There are some new exceptions that might be raised in response to
+   network issues or TLS protocol failures. Refer to the
+   Exceptions_ section of the manual for more details.
 
 Please refer to the "TLS/SSL" section of the manual for more details
 on all of the above.
@@ -41,6 +44,8 @@ on all of the above.
 Many thanks to Chris Arndt and Marc-Antoine Parent for their input
 into these TLS improvements.
 
+.. _Exceptions: http://imapclient.readthedocs.org/en/latest/#exceptions
+
 STARTTLS support [NEW]
 ----------------------
 When the server supports it, IMAPClient can now establish an encrypted