m4us.core.exceptions

Provides all the custom exceptions for the project core.

Inheritance Diagram

Inheritance diagram of m4us.core.exceptions

Members

exception DuplicateError(message=None, **kwargs)[source]

Bases: m4us.core.exceptions.M4USException

Raised when attempting to register an already registered coroutine.

The default exception message requires a coroutine attribute or keyword argument.

exception InvalidLinkError(message=None, **kwargs)[source]

Bases: m4us.core.exceptions.M4USException

Raised when a link between a container and it's child is invalid.

The default exception message requires source_outbox and sink_inbox attributes or keyword arguments.

exception LinkExistsError(message=None, **kwargs)[source]

Bases: m4us.core.exceptions.M4USException

Raised when a link already exists in a post office.

The default exception message requires a link attribute or keyword argument.

exception M4USException(message=None, **kwargs)[source]

Bases: exceptions.Exception

Base class for all exceptions in this project.

Despite Python's deprecation of the message attribute, sub-classes of this exception can (and should) set the _message attribute to be a default message or message template (see below). The message can also be overridden by the first positional argument.

Additionally, any keyword arguments given at instantiation will become attributes of the instance. This allows for additional context to be provided when appropriate.

Finally, it is expected that only the Unicode representation of the exception will be used. That representation will substitute any fields in the form of {field} with instance or class attributes.

Parameters:
  • message (unicode) -- Optional overridden message or message template to use.
  • kwargs (collections.Mapping) -- Any keyword arguments to convert to instance attributes.

See also

Python's new string formatting method for details on string templates.

_message = u'An exception occurred in the m4us package.'

Default message or message template for the exception.

Type :unicode

Note

This should be overridden by sub-classes.

exception NeverRunError(message=None, **kwargs)[source]

Bases: m4us.core.exceptions.M4USException

Raised if a lazy coroutine will never receive any messages.

The default exception message requires a coroutine attribute or keyword argument.

exception NoLinkError(message=None, **kwargs)[source]

Bases: m4us.core.exceptions.M4USException

Raised when a particular link has not already been established.

The default exception message requires source_outbox and sink_inbox attributes or keyword arguments.

exception NotASinkError(message=None, **kwargs)[source]

Bases: m4us.core.exceptions.M4USException

Raised when a coroutine is not configured to receive messages.

The default exception message requires a coroutine attribute or keyword argument.

exception NotAddedError(message=None, **kwargs)[source]

Bases: m4us.core.exceptions.M4USException

Raised when attempting to unregister an unknown coroutine.

The default exception message requires a coroutine attribute or keyword argument.

Table Of Contents

Previous topic

m4us.core.coroutines

Next topic

m4us.core.interfaces

This Page