Source

# -*- coding: utf-8 -*-""" sphinx.errors ~~~~~~~~~~~~~ Contains SphinxError and a few subclasses (in an extra module to avoid circular import problems). :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details."""classSphinxError(Exception):""" Base class for Sphinx errors that are shown to the user in a nicer way than normal exceptions. """category='Sphinx error'classSphinxWarning(SphinxError):"""Raised for warnings if warnings are treated as errors."""category='Warning, treated as error'classExtensionError(SphinxError):"""Raised if something's wrong with the configuration."""category='Extension error'def__init__(self,message,orig_exc=None):SphinxError.__init__(self,message)self.orig_exc=orig_excdef__repr__(self):ifself.orig_exc:return'%s(%r, %r)'%(self.__class__.__name__,self.message,self.orig_exc)return'%s(%r)'%(self.__class__.__name__,self.message)def__str__(self):parent_str=SphinxError.__str__(self)ifself.orig_exc:return'%s (exception: %s)'%(parent_str,self.orig_exc)returnparent_strclassConfigError(SphinxError):category='Configuration error'classThemeError(SphinxError):category='Theme error'