taskflow.exceptions.
raise_with_cause
(exc_cls, message, *args, **kwargs)[source]¶Helper to raise + chain exceptions (when able) and associate a cause.
NOTE(harlowja): Since in py3.x exceptions can be chained (due to
PEP 3134) we should try to raise the desired exception with the given
cause (or extract a cause from the current stack if able) so that the
exception formats nicely in old and new versions of python. Since py2.x
does not support exception chaining (or formatting) our root exception
class has a pformat()
method that can be used to get similar information instead (and this
function makes sure to retain the cause in that case as well so
that the pformat()
method
shows them).
Parameters: |
|
---|
taskflow.exceptions.
TaskFlowException
(message, cause=None)[source]¶Bases: exceptions.Exception
Base class for most exceptions emitted from this library.
NOTE(harlowja): in later versions of python we can likely remove the need
to have a cause
here as PY3+ have implemented PEP 3134 which
handles chaining in a much more elegant manner.
Parameters: |
|
---|
taskflow.exceptions.
StorageFailure
(message, cause=None)[source]¶Bases: taskflow.exceptions.TaskFlowException
Raised when storage backends can not be read/saved/deleted.
taskflow.exceptions.
ConductorFailure
(message, cause=None)[source]¶Bases: taskflow.exceptions.TaskFlowException
Errors related to conducting activities.
taskflow.exceptions.
JobFailure
(message, cause=None)[source]¶Bases: taskflow.exceptions.TaskFlowException
Errors related to jobs or operations on jobs.
taskflow.exceptions.
UnclaimableJob
(message, cause=None)[source]¶Bases: taskflow.exceptions.JobFailure
Raised when a job can not be claimed.
taskflow.exceptions.
ExecutionFailure
(message, cause=None)[source]¶Bases: taskflow.exceptions.TaskFlowException
Errors related to engine execution.
taskflow.exceptions.
RequestTimeout
(message, cause=None)[source]¶Bases: taskflow.exceptions.ExecutionFailure
Raised when a worker request was not finished within allotted time.
taskflow.exceptions.
InvalidState
(message, cause=None)[source]¶Bases: taskflow.exceptions.ExecutionFailure
Raised when a invalid state transition is attempted while executing.
taskflow.exceptions.
DependencyFailure
(message, cause=None)[source]¶Bases: taskflow.exceptions.TaskFlowException
Raised when some type of dependency problem occurs.
taskflow.exceptions.
AmbiguousDependency
(message, cause=None)[source]¶Bases: taskflow.exceptions.DependencyFailure
Raised when some type of ambiguous dependency problem occurs.
taskflow.exceptions.
MissingDependencies
(who, requirements, cause=None, method=None)[source]¶Bases: taskflow.exceptions.DependencyFailure
Raised when a entity has dependencies that can not be satisfied.
Parameters: |
|
---|
Further arguments are interpreted as for in
TaskFlowException
.
MESSAGE_TPL
= "'%(who)s' requires %(requirements)s but no other entity produces said requirements"¶Exception message template used when creating an actual message.
taskflow.exceptions.
CompilationFailure
(message, cause=None)[source]¶Bases: taskflow.exceptions.TaskFlowException
Raised when some type of compilation issue is found.
taskflow.exceptions.
IncompatibleVersion
(message, cause=None)[source]¶Bases: taskflow.exceptions.TaskFlowException
Raised when some type of version incompatibility is found.
taskflow.exceptions.
Duplicate
(message, cause=None)[source]¶Bases: taskflow.exceptions.TaskFlowException
Raised when a duplicate entry is found.
taskflow.exceptions.
NotFound
(message, cause=None)[source]¶Bases: taskflow.exceptions.TaskFlowException
Raised when some entry in some object doesn’t exist.
taskflow.exceptions.
Empty
(message, cause=None)[source]¶Bases: taskflow.exceptions.TaskFlowException
Raised when some object is empty when it shouldn’t be.
taskflow.exceptions.
MultipleChoices
(message, cause=None)[source]¶Bases: taskflow.exceptions.TaskFlowException
Raised when some decision can’t be made due to many possible choices.
taskflow.exceptions.
InvalidFormat
(message, cause=None)[source]¶Bases: taskflow.exceptions.TaskFlowException
Raised when some object/entity is not in the expected format.
taskflow.exceptions.
DisallowedAccess
(message, cause=None, state=None)[source]¶Bases: taskflow.exceptions.TaskFlowException
Raised when storage access is not possible due to state limitations.
taskflow.exceptions.
NotImplementedError
[source]¶Bases: exceptions.NotImplementedError
Exception for when some functionality really isn’t implemented.
This is typically useful when the library itself needs to distinguish internal features not being made available from users features not being made available/implemented (and to avoid misinterpreting the two).
taskflow.exceptions.
WrappedFailure
(causes)[source]¶Bases: taskflow.utils.mixins.StrMixin
, exceptions.Exception
Wraps one or several failure objects.
When exception/s cannot be re-raised (for example, because the value and traceback are lost in serialization) or there are several exceptions active at the same time (due to more than one thread raising exceptions), we will wrap the corresponding failure objects into this exception class and may reraise this exception type to allow users to handle the contained failures/causes as they see fit…
See the failure class documentation for a more comprehensive set of reasons why this object may be reraised instead of the original exception.
Parameters: | causes – the Failure objects
that caused this this exception to be raised. |
---|
check
(*exc_classes)[source]¶Check if any of exception classes caused the failure/s.
Parameters: | exc_classes – exception types/exception type names to search for. |
---|
If any of the contained failures were caused by an exception of a given type, the corresponding argument that matched is returned. If not then none is returned.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.