4.6. foundations.exceptions

exceptions.py

Platform:
Windows, Linux, Mac Os X.
Description:
This module defines Foundations package exceptions and others exception handling related objects.

Others:

4.6.1. Module Attributes

foundations.exceptions.LOGGER

4.6.2. Functions

foundations.exceptions.exceptionsHandler(handler=None, raiseException=False, *args)[source]
This decorator is used for exceptions handling.
It’s possible to specify an user defined exception handler, if not, defaultExceptionsHandler() handler will be used.
The decorator uses given exceptions objects or the default Python Exception class.

Usage:

@exceptionsHandler(None, False, ZeroDivisionError)
def raiseAnException(value):
        '''
        This definition raises a 'ZeroDivisionError' exception.
        '''

        return value / 0;
Parameters:
  • handler – Custom handler. ( Object )
  • raiseException – Raise the exception. ( Boolean )
  • *args – Exceptions. ( Exceptions )
Returns:

Object. ( Object )

foundations.exceptions.defaultExceptionsHandler(exception, traceName, *args, **kwargs)[source]

This definition provides the default exception handler.

This handler verboses some informations about the handled exception:

  • Exception traceName.
  • Exception class.
  • Exception description / documentation.
  • Error message.
  • Exception traceback.
Parameters:
  • exception – Exception. ( Exception )
  • traceName – Function / Method raising the exception. ( String )
  • *args – Arguments. ( * )
  • **kwargs – Keywords arguments. ( ** )
Returns:

Definition success. ( Boolean )

4.6.3. Classes

class foundations.exceptions.AbstractError(value)[source]

Bases: exceptions.Exception

This class is the abstract base class for all Foundations package exceptions.

Parameters:value – Error value or message. ( String )
value[source]

This method is the property for self.__value attribute.

Returns:self.__value. ( Object )
class foundations.exceptions.BreakIteration(value)[source]

Bases: foundations.exceptions.AbstractError

This class is used to break nested loop iterations.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.AbstractParsingError(value)[source]

Bases: foundations.exceptions.AbstractError

This class is the abstract base class for parsing related exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.FileStructureParsingError(value)[source]

Bases: foundations.exceptions.AbstractParsingError

This class is used for exceptions raised while parsing file structure.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.AttributeStructureParsingError(value, line=None)[source]

Bases: foundations.exceptions.AbstractParsingError

This class is used for exceptions raised while parsing attribute structure.

Parameters:
  • value – Error value or message. ( String )
  • line – Line number where exception occured. ( Integer )
line[source]

This method is the property for self.__line attribute.

Returns:self.__line. ( Integer )
class foundations.exceptions.AbstractOsError(value)[source]

Bases: foundations.exceptions.AbstractError

This class is the abstract base class for os related exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.PathExistsError(value)[source]

Bases: foundations.exceptions.AbstractOsError

This class is used for non existing path exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.DirectoryExistsError(value)[source]

Bases: foundations.exceptions.PathExistsError

This class is used for non existing directory exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.FileExistsError(value)[source]

Bases: foundations.exceptions.PathExistsError

This class is used for non existing file exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.AbstractObjectError(value)[source]

Bases: foundations.exceptions.AbstractError

This class is the abstract base class for object related exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.ObjectTypeError(value)[source]

Bases: foundations.exceptions.AbstractObjectError

This class is used for invalid object type exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.ObjectExistsError(value)[source]

Bases: foundations.exceptions.AbstractObjectError

This class is used for non existing object exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.AbstractUserError(value)[source]

Bases: foundations.exceptions.AbstractError

This class is the abstract base class for user related exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.ProgrammingError(value)[source]

Bases: foundations.exceptions.AbstractUserError

This class is used for programming exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.UserError(value)[source]

Bases: foundations.exceptions.AbstractUserError

This class is used for user exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.AbstractNodeError(value)[source]

Bases: foundations.exceptions.AbstractError

This class is the abstract base class for node related exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.NodeAttributeTypeError(value)[source]

Bases: foundations.exceptions.AbstractNodeError, foundations.exceptions.ObjectTypeError

This class is the abstract base class for node attributes type related exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.NodeAttributeExistsError(value)[source]

Bases: foundations.exceptions.AbstractNodeError, foundations.exceptions.ObjectExistsError

This class is used for non existing node attribute exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.AbstractLibraryError(value)[source]

Bases: foundations.exceptions.AbstractError

This class is the abstract base class for library module exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.LibraryInstantiationError(value)[source]

Bases: foundations.exceptions.AbstractLibraryError

This class is used for library module library.Library class instantiation exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.LibraryInitializationError(value)[source]

Bases: foundations.exceptions.AbstractLibraryError

This class is used for library module library.Library class initialization exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.LibraryExecutionError(value)[source]

Bases: foundations.exceptions.AbstractLibraryError

This class is used for library module library.Library class execution exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.AbstractServerError(value)[source]

Bases: foundations.exceptions.AbstractError

This class is the abstract base class for tcpServer module exceptions.

Parameters:value – Error value or message. ( String )
class foundations.exceptions.ServerOperationError(value)[source]

Bases: foundations.exceptions.AbstractServerError

This class is used for tcpServer module tcpServer.TCPServer class operations exceptions.

Parameters:value – Error value or message. ( String )

Table Of Contents

Previous topic

4.5. foundations.environment

Next topic

4.7. foundations.globals.constants

This Page