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
432 433 434 435 436 |
# File 'lib/roby/standard_errors.rb', line 432 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.
427 428 429 |
# File 'lib/roby/standard_errors.rb', line 427 def reason @reason end |
Instance Method Details
#pretty_print(pp) ⇒ Object
438 439 440 441 442 443 444 445 446 447 |
# File 'lib/roby/standard_errors.rb', line 438 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
429 |
# File 'lib/roby/standard_errors.rb', line 429 def propagated?; false end |