Exception: Roby::ActionStateTransitionFailed

Inherits:
LocalizedError show all
Defined in:
lib/roby/standard_errors.rb

Overview

Exception used when a state transition fails within an action state machine

Instance Attribute Summary collapse

Attributes inherited from LocalizedError

#failed_event, #failed_generator, #failed_task, #failure_point

Attributes inherited from ExceptionBase

#original_exceptions

Instance Method Summary collapse

Methods inherited from LocalizedError

#fatal?, #involved_plan_object?, match, #propagated?, #to_execution_exception, to_execution_exception_matcher

Methods included from DRoby::V5::LocalizedErrorDumper

#droby_dump

Methods inherited from ExceptionBase

#each_original_exception, #report_exceptions_from

Methods included from DRoby::V5::ExceptionBaseDumper

#droby_dump

Methods included from DRoby::V5::Builtins::ExceptionDumper

#droby_dump

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

#eventEvent (readonly)

The event that caused the transition

Returns:



619
620
621
# File 'lib/roby/standard_errors.rb', line 619

def event
  @event
end

#from_stateCoordination::Task (readonly)

The state that we’re transitioning out of

Returns:



616
617
618
# File 'lib/roby/standard_errors.rb', line 616

def from_state
  @from_state
end

#to_stateCoordination::Task (readonly)

The state that we were transitioning into

Returns:



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