Exception: Roby::ActionStateTransitionFailed
- Inherits:
-
LocalizedError
- Object
- RuntimeError
- ExceptionBase
- LocalizedError
- Roby::ActionStateTransitionFailed
- Defined in:
- lib/roby/standard_errors.rb
Overview
Exception used when a state transition fails within an action state machine
Instance Attribute Summary collapse
-
#event ⇒ Event
readonly
The event that caused the transition.
-
#from_state ⇒ Coordination::Task
readonly
The state that we’re transitioning out of.
-
#to_state ⇒ Coordination::Task
readonly
The state that we were transitioning into.
Attributes inherited from LocalizedError
#failed_event, #failed_generator, #failed_task, #failure_point
Attributes inherited from ExceptionBase
Instance Method Summary collapse
-
#initialize(root_task, from_state, event, to_state, original_exception) ⇒ ActionStateTransitionFailed
constructor
A new instance of ActionStateTransitionFailed.
- #pretty_print(pp) ⇒ Object
Methods inherited from LocalizedError
#fatal?, #involved_plan_object?, match, #propagated?, #to_execution_exception, to_execution_exception_matcher
Methods included from DRoby::V5::LocalizedErrorDumper
Methods inherited from ExceptionBase
#each_original_exception, #report_exceptions_from
Methods included from DRoby::V5::ExceptionBaseDumper
Methods included from DRoby::V5::Builtins::ExceptionDumper
Constructor Details
#initialize(root_task, from_state, event, to_state, original_exception) ⇒ ActionStateTransitionFailed
Returns a new instance of ActionStateTransitionFailed.
624 625 626 627 628 629 630 |
# File 'lib/roby/standard_errors.rb', line 624 def initialize(root_task, from_state, event, to_state, original_exception) super(root_task) @from_state = from_state @event = event @to_state = to_state report_exceptions_from(original_exception) end |
Instance Attribute Details
#event ⇒ Event (readonly)
The event that caused the transition
619 620 621 |
# File 'lib/roby/standard_errors.rb', line 619 def event @event end |
#from_state ⇒ Coordination::Task (readonly)
The state that we’re transitioning out of
616 617 618 |
# File 'lib/roby/standard_errors.rb', line 616 def from_state @from_state end |
#to_state ⇒ Coordination::Task (readonly)
The state that we were transitioning into
622 623 624 |
# File 'lib/roby/standard_errors.rb', line 622 def to_state @to_state end |
Instance Method Details
#pretty_print(pp) ⇒ Object
632 633 634 635 636 637 638 639 640 641 642 643 644 645 |
# File 'lib/roby/standard_errors.rb', line 632 def pretty_print(pp) pp.text "#{failed_task} failed a state transition" pp.nest(2) do pp.breakable pp.text "from state " pp.nest(2) { from_state.pretty_print(pp) } pp.breakable pp.text "to state " pp.nest(2) { to_state.pretty_print(pp) } pp.breakable pp.text "caused by event " pp.nest(2) { event.pretty_print(pp) } end end |