Source code for umbra.exceptions

#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
**exceptions.py**

**Platform:**
	Windows, Linux, Mac Os X.

**Description:**
	Defines **Umbra** package exceptions.

**Others:**

"""

#**********************************************************************************************************************
#***	Future imports.
#**********************************************************************************************************************
from __future__ import unicode_literals

#**********************************************************************************************************************
#***	Internal imports.
#**********************************************************************************************************************
import foundations.exceptions
from umbra.globals.runtimeGlobals import RuntimeGlobals
from umbra.globals.uiConstants import UiConstants

#**********************************************************************************************************************
#***	Module attributes.
#**********************************************************************************************************************
__author__ = "Thomas Mansencal"
__copyright__ = "Copyright (C) 2008 - 2014 - Thomas Mansencal"
__license__ = "GPL V3.0 - http://www.gnu.org/licenses/"
__maintainer__ = "Thomas Mansencal"
__email__ = "[email protected]"
__status__ = "Production"

__all__ = ["LOGGER",
		"notifyExceptionHandler",
		"AbstractEngineError",
		"EngineConfigurationError",
		"EngineInitializationError",
		"ResourceExistsError",
		"AbstractActionsManagerError",
		"CategoryExistsError",
		"ActionExistsError",
		"AbstractPatchesManagerError",
		"PatchRegistrationError",
		"PatchInterfaceError",
		"PatchApplyError",
		"AbstractLayoutsManagerError",
		"LayoutRegistrationError",
		"LayoutExistError",
		"AbstractFileSystemEventsManagerError",
		"PathRegistrationError",
		"PathExistsError",
		"AbstractLanguageError",
		"LanguageGrammarError"]

#**********************************************************************************************************************
#***	Module classes and definitions.
#**********************************************************************************************************************
[docs]def notifyExceptionHandler(*args): """ Provides a notifier exception handler. :param \*args: Arguments. :type \*args: \* :return: Definition success. :rtype: bool """ callback = RuntimeGlobals.componentsManager["factory.scriptEditor"].restoreDevelopmentLayout foundations.exceptions.baseExceptionHandler(*args) cls, instance = foundations.exceptions.extractException(*args)[:2] RuntimeGlobals.notificationsManager.exceptify(message="{0}".format(instance), notificationClickedSlot=callback) return True
[docs]class AbstractEngineError(foundations.exceptions.AbstractError): """ Defines the abstract base class for engine related exceptions. """ pass
[docs]class EngineConfigurationError(AbstractEngineError): """ Defines engine configuration exception. """ pass
[docs]class EngineInitializationError(AbstractEngineError): """ Defines engine initialization exception. """ pass
[docs]class ResourceExistsError(foundations.exceptions.AbstractOsError): """ Defines non existing resource exception. """ pass
[docs]class AbstractActionsManagerError(foundations.exceptions.AbstractError): """ Defines the abstract base class for :class:`umbra.managers.actionsManager.ActionsManager` related exceptions. """ pass
[docs]class CategoryExistsError(AbstractActionsManagerError): """ Defines non existing category exception. """ pass
[docs]class ActionExistsError(AbstractActionsManagerError): """ Defines non existing action exception. """ pass
[docs]class AbstractPatchesManagerError(foundations.exceptions.AbstractError): """ Defines the abstract base class for :class:`umbra.managers.patchesManager.PatchesManager` related exceptions. """ pass
[docs]class PatchRegistrationError(AbstractPatchesManagerError): """ Defines patch registration exception. """ pass
[docs]class PatchInterfaceError(AbstractPatchesManagerError): """ Defines patch interface exception. """ pass
[docs]class PatchApplyError(AbstractPatchesManagerError): """ Defines patch apply exception. """ pass
[docs]class AbstractLayoutsManagerError(foundations.exceptions.AbstractError): """ Defines the abstract base class for :class:`umbra.managers.layoutsManager.LayoutsManager` related exceptions. """ pass
[docs]class LayoutRegistrationError(AbstractLayoutsManagerError): """ Defines layout registration exception. """ pass
[docs]class LayoutExistError(AbstractLayoutsManagerError): """ Defines non existing layout exception. """ pass
[docs]class AbstractFileSystemEventsManagerError(foundations.exceptions.AbstractError): """ Defines the abstract base class for :class:`umbra.managers.fileSystemEventsManager.FileSystemEventsManager` related exceptions. """ pass
[docs]class PathRegistrationError(AbstractFileSystemEventsManagerError): """ Defines path registration exception. """ pass
[docs]class PathExistsError(AbstractFileSystemEventsManagerError): """ Defines non existing path exception. """ pass
[docs]class AbstractLanguageError(foundations.exceptions.AbstractError): """ Defines the abstract base class for language related exceptions. """ pass
[docs]class LanguageGrammarError(AbstractLanguageError): """ Defines language grammar exception. """ pass