diff options
Diffstat (limited to 'sphinx/errors.py')
-rw-r--r-- | sphinx/errors.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sphinx/errors.py b/sphinx/errors.py index 5db68dd..44df3e8 100644 --- a/sphinx/errors.py +++ b/sphinx/errors.py @@ -25,16 +25,19 @@ class SphinxError(Exception): exception to a string ("category: message"). Should be set accordingly in subclasses. """ + category = 'Sphinx error' class SphinxWarning(SphinxError): """Warning, treated as error.""" + category = 'Warning, treated as error' class ApplicationError(SphinxError): """Application initialization error.""" + category = 'Application error' @@ -42,7 +45,7 @@ class ExtensionError(SphinxError): """Extension error.""" def __init__( - self, message: str, orig_exc: Exception | None = None, modname: str | None = None, + self, message: str, orig_exc: Exception | None = None, modname: str | None = None ) -> None: super().__init__(message) self.message = message @@ -70,26 +73,31 @@ class ExtensionError(SphinxError): class BuildEnvironmentError(SphinxError): """BuildEnvironment error.""" + category = 'BuildEnvironment error' class ConfigError(SphinxError): """Configuration error.""" + category = 'Configuration error' class DocumentError(SphinxError): """Document error.""" + category = 'Document error' class ThemeError(SphinxError): """Theme error.""" + category = 'Theme error' class VersionRequirementError(SphinxError): """Incompatible Sphinx version error.""" + category = 'Sphinx version error' @@ -118,10 +126,13 @@ class PycodeError(Exception): class NoUri(Exception): """Raised by builder.get_relative_uri() or from missing-reference handlers - if there is no URI available.""" + if there is no URI available. + """ + pass class FiletypeNotFoundError(Exception): """Raised by get_filetype() if a filename matches no source suffix.""" + pass |