Exception: Roby::ToplevelTaskError
- Inherits:
-
LocalizedError
- Object
- RuntimeError
- ExceptionBase
- LocalizedError
- Roby::ToplevelTaskError
- Includes:
- UserExceptionWrapper
- Defined in:
- lib/roby/standard_errors.rb
Overview
Exception raised when a mission has failed
Direct Known Subclasses
Instance Attribute Summary collapse
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Attributes inherited from LocalizedError
#failed_event, #failed_generator, #failed_task, #failure_point
Attributes inherited from ExceptionBase
Instance Method Summary collapse
-
#initialize(task, reason = nil) ⇒ ToplevelTaskError
constructor
Create a new MissionFailedError for the given mission.
- #pretty_print(pp) ⇒ Object
- #propagated? ⇒ Boolean
Methods inherited from LocalizedError
#fatal?, #involved_plan_object?, match, #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(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
#reason ⇒ Object (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
522 523 524 |
# File 'lib/roby/standard_errors.rb', line 522 def propagated? false end |