Exception: Roby::ToplevelTaskError

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

Overview

Exception raised when a mission has failed

Direct Known Subclasses

MissionFailedError, PermanentTaskError

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, #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(task, reason = nil) ⇒ ToplevelTaskError

Create a new MissionFailedError for the given mission



527
528
529
530
531
# File 'lib/roby/standard_errors.rb', line 527

def initialize(task, reason = nil)
    super(task.failure_event || task)
    @reason = reason || task.failure_reason
    report_exceptions_from(@reason)
end

Instance Attribute Details

#reasonObject (readonly)

Returns the value of attribute reason.



520
521
522
# File 'lib/roby/standard_errors.rb', line 520

def reason
  @reason
end

Instance Method Details

#pretty_print(pp) ⇒ Object



533
534
535
536
537
538
539
540
541
542
543
# File 'lib/roby/standard_errors.rb', line 533

def pretty_print(pp)
    if reason
        reason.pretty_print(pp)
    elsif failed_event
        failed_event.pretty_print(pp)
    else
        explanation =
            :success.to_unbound_task_predicate.explain_static(failed_task)
        explanation.pretty_print(pp)
    end
end

#propagated?Boolean

Returns:

  • (Boolean)


522
523
524
# File 'lib/roby/standard_errors.rb', line 522

def propagated?
    false
end