Exception: Roby::QuarantinedTaskError
- Inherits:
-
LocalizedError
- Object
- RuntimeError
- ExceptionBase
- LocalizedError
- Roby::QuarantinedTaskError
- Defined in:
- lib/roby/standard_errors.rb
Overview
Exception raised when a quarantined task is in use by other parts of the plan
Quarantines are used to indicate a failure of the framework to control a task. The most common case is a failure to stop the task.
Instance Attribute Summary collapse
-
#reason ⇒ String, Exception
readonly
A reason for the quarantine, either as a plain message, or as the exception object that caused it.
Attributes inherited from LocalizedError
#failed_event, #failed_generator, #failed_task, #failure_point
Attributes inherited from ExceptionBase
Instance Method Summary collapse
-
#initialize(task) ⇒ QuarantinedTaskError
constructor
A new instance of QuarantinedTaskError.
- #message ⇒ Object
- #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(task) ⇒ QuarantinedTaskError
Returns a new instance of QuarantinedTaskError.
261 262 263 264 265 266 |
# File 'lib/roby/standard_errors.rb', line 261 def initialize(task) super(task) @reason = task.quarantine_reason report_exceptions_from(reason) end |
Instance Attribute Details
#reason ⇒ String, Exception (readonly)
Returns a reason for the quarantine, either as a plain message, or as the exception object that caused it. In the latter case, the exception object will be registered as one of the error’s ExceptionBase#original_exceptions.
259 260 261 |
# File 'lib/roby/standard_errors.rb', line 259 def reason @reason end |
Instance Method Details
#message ⇒ Object
268 269 270 271 272 273 274 275 276 |
# File 'lib/roby/standard_errors.rb', line 268 def if @reason.respond_to?(:to_str) @reason elsif original_exceptions.include?(reason) super else PP.pp(reason, +"") end end |
#pretty_print(pp) ⇒ Object
278 279 280 281 282 283 |
# File 'lib/roby/standard_errors.rb', line 278 def pretty_print(pp) pp.text "The following task has been put in quarantine" pp.breakable super end |