Packageorg.spicefactory.lib.command.events
Classpublic class CommandFailure
InheritanceCommandFailure Inheritance Object

Represents a failure of a command executor. This class does not extend Error or ErrorEvent. It is the type of cause an comand executor like a group or flow would pass to the error callbacks. It allows to inspect the cause of the error as well as the executor and the target command that caused the error.



Public Properties
 PropertyDefined By
  cause : Object
[read-only] The cause of the error.
CommandFailure
  executor : CommandExecutor
[read-only] The instance that executed the target command that caused the error.
CommandFailure
  message : String
[read-only] A textual representation of the failure.
CommandFailure
  rootCause : Object
[read-only] The root cause of the error in case of nested commands.
CommandFailure
  target : Object
[read-only] The target command that caused the error.
CommandFailure
Public Methods
 MethodDefined By
  
CommandFailure(executor:CommandExecutor, target:Object, cause:Object)
Creates a new instance.
CommandFailure
Property Detail
causeproperty
cause:Object  [read-only]

The cause of the error. Usually an instance of Error, ErrorEvent or CommandTimeout, but may be any type like a simple String.


Implementation
    public function get cause():Object
executorproperty 
executor:CommandExecutor  [read-only]

The instance that executed the target command that caused the error.


Implementation
    public function get executor():CommandExecutor
messageproperty 
message:String  [read-only]

A textual representation of the failure.


Implementation
    public function get message():String
rootCauseproperty 
rootCause:Object  [read-only]

The root cause of the error in case of nested commands. When executing a command sequence or flow the individual commands might themselves be sequences or flows. In this case the cause property may hold another instance of CommandFailure. This property always returns the root cause as produced by the actual target command.


Implementation
    public function get rootCause():Object
targetproperty 
target:Object  [read-only]

The target command that caused the error.


Implementation
    public function get target():Object
Constructor Detail
CommandFailure()Constructor
public function CommandFailure(executor:CommandExecutor, target:Object, cause:Object)

Creates a new instance.

Parameters
executor:CommandExecutor — the instance that executed the target command that caused the error
 
target:Object — the target command that caused the error
 
cause:Object — the cause of the error