Source code for fobi.exceptions

__title__ = 'fobi.exceptions'
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
__copyright__ = '2014-2015 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'
__all__ = (
    'BaseException', 'ImproperlyConfigured', 'InvalidRegistryItemType', 
    'DoesNotExist', 'ThemeDoesNotExist', 'PluginDoesNotExist',
    'FormElementPluginDoesNotExist', 'FormHandlerPluginDoesNotExist',
    'NoDefaultThemeSet', 'FormPluginError', 'FormElementPluginError',
    'FormHandlerPluginError', 'FormCallbackError',
)

[docs]class BaseException(Exception): """ Base exception. """
[docs]class ImproperlyConfigured(BaseException): """ Exception raised when developer didn't configure/write the code properly. """
[docs]class InvalidRegistryItemType(ValueError, BaseException): """ Raised when an attempt is made to register an item in the registry which does not have a proper type. """
[docs]class DoesNotExist(BaseException): """ Raised when something does not exist. """
[docs]class ThemeDoesNotExist(DoesNotExist): """ Raised when no theme with given uid can be found. """
[docs]class PluginDoesNotExist(DoesNotExist): """ Raised when no plugin with given uid can be found. """
[docs]class FormElementPluginDoesNotExist(PluginDoesNotExist): """ Raised when no form element plugin with given uid can be found. """
[docs]class FormHandlerPluginDoesNotExist(PluginDoesNotExist): """ Raised when no form handler plugin with given uid can be found. """
[docs]class NoDefaultThemeSet(ImproperlyConfigured): """ Raised when no active theme is chosen. """
[docs]class FormPluginError(BaseException): """ Base error for form elements and handers. """
[docs]class FormElementPluginError(FormPluginError): """ Raised when form element plugin error occurs. """
[docs]class FormHandlerPluginError(FormPluginError): """ Raised when form handler plugin error occurs. """
[docs]class FormCallbackError(FormPluginError): """ Raised when form callback error occurs. """