diff options
author | Stephen Finucane <stephen@that.guru> | 2018-01-14 21:55:51 +0000 |
---|---|---|
committer | Stephen Finucane <stephen@that.guru> | 2018-01-20 13:04:29 +0000 |
commit | 3a85b3502fcbf03c6bfe2b3b67af220c90180425 (patch) | |
tree | 3b03f010e32ad51f2fcdad781d41884a23825335 /sphinx/errors.py | |
parent | ae620e16f7d6c0f6f1c475867c471f66c3a11458 (diff) | |
download | sphinx-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.py | 5 |
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' |