summaryrefslogtreecommitdiff
path: root/sphinx/errors.py
diff options
context:
space:
mode:
authorStephen Finucane <stephen@that.guru>2018-01-14 21:55:51 +0000
committerStephen Finucane <stephen@that.guru>2018-01-20 13:04:29 +0000
commit3a85b3502fcbf03c6bfe2b3b67af220c90180425 (patch)
tree3b03f010e32ad51f2fcdad781d41884a23825335 /sphinx/errors.py
parentae620e16f7d6c0f6f1c475867c471f66c3a11458 (diff)
downloadsphinx-git-3a85b3502fcbf03c6bfe2b3b67af220c90180425.tar.gz
app: Centralize directory validation
This allows us to avoid duplication of code and ensure validation happens regardless of who's initializing the class. We introduce a new exception - ApplicationError - to indicate these kinds of issues. This subclasses SphinxError, meaning we don't need to modify our exception handling code. Signed-off-by: Stephen Finucane <stephen@that.guru>
Diffstat (limited to 'sphinx/errors.py')
-rw-r--r--sphinx/errors.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/sphinx/errors.py b/sphinx/errors.py
index eef1a157a..10cdfbb2d 100644
--- a/sphinx/errors.py
+++ b/sphinx/errors.py
@@ -28,6 +28,11 @@ class SphinxWarning(SphinxError):
category = 'Warning, treated as error'
+class ApplicationError(SphinxError):
+ """Application initialization error."""
+ category = 'Application error'
+
+
class ExtensionError(SphinxError):
"""Raised if something's wrong with the configuration."""
category = 'Extension error'