summaryrefslogtreecommitdiff
path: root/doc/extdev
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-01-21 09:54:31 +0100
committerGeorg Brandl <georg@python.org>2014-01-21 09:54:31 +0100
commit9739c13d6a88970d55347408e0ff134be6cb5daf (patch)
tree9b5af2dbf9fba98f7319da49df6d7c20bbee32ee /doc/extdev
parentd3db46164e65f031aee3f5059b0bfc7cc22bb41e (diff)
downloadsphinx-9739c13d6a88970d55347408e0ff134be6cb5daf.tar.gz
doc: add exceptions from sphinx.errors
Diffstat (limited to 'doc/extdev')
-rw-r--r--doc/extdev/appapi.rst50
1 files changed, 50 insertions, 0 deletions
diff --git a/doc/extdev/appapi.rst b/doc/extdev/appapi.rst
index b91f6c72..7769fbca 100644
--- a/doc/extdev/appapi.rst
+++ b/doc/extdev/appapi.rst
@@ -356,6 +356,12 @@ Producing messages / logging
The application object also provides support for emitting leveled messages.
+.. note::
+
+ There is no "error" call: in Sphinx, errors are defined as things that stop
+ the build; for that just raise an exception (:exc:`sphinx.errors.SphinxError`
+ or a custom subclass) to do that.
+
.. automethod:: Sphinx.warn
.. automethod:: Sphinx.info
@@ -532,3 +538,47 @@ The template bridge
.. autoclass:: TemplateBridge
:members:
+
+
+.. _exceptions:
+
+Exceptions
+----------
+
+.. module:: sphinx.errors
+
+.. class:: SphinxError
+
+ This is the base class for "nice" exceptions. When such an exception is
+ raised, Sphinx will abort the build and present the exception category and
+ message to the user.
+
+ Extensions are encouraged to derive from this exception for their custom
+ errors.
+
+ Exceptions *not* derived from :exc:`SphinxError` are treated as unexpected
+ and shown to the user with a part of the traceback (and the full traceback
+ saved in a temporary file).
+
+ .. attribute:: category
+
+ Description of the exception "category", used in converting the exception
+ to a string ("category: message"). Should be set accordingly in
+ subclasses.
+
+.. class:: ConfigError
+
+ Used for erroneous values or nonsensical combinations of configuration
+ values.
+
+.. class:: ExtensionError
+
+ Used for errors in setting up extensions.
+
+.. class:: ThemeError
+
+ Used for errors to do with themes.
+
+.. class:: VersionRequirementError
+
+ Raised when the docs require a higher Sphinx version than the current one.