Exception: Roby::TaskEmergencyTermination

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

Overview

Raised when an error occurs on a task while we were terminating it

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(task, reason, quarantined = false) ⇒ TaskEmergencyTermination

Returns a new instance of TaskEmergencyTermination.



222
223
224
225
226
227
228
# File 'lib/roby/standard_errors.rb', line 222

def initialize(task, reason, quarantined = false)
    super(task)

    @quarantined = quarantined
    @reason = reason
    report_exceptions_from(reason)
end

Instance Attribute Details

#reasonObject (readonly)

Returns the value of attribute reason.



216
217
218
# File 'lib/roby/standard_errors.rb', line 216

def reason
  @reason
end

Instance Method Details

#pretty_print(pp) ⇒ Object



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/roby/standard_errors.rb', line 230

def pretty_print(pp)
    pp.text "The following task is being terminated because of "\
            "an internal error"
    pp.breakable
    if quarantined?
        pp.text "It has been put under quarantine"
    else
        pp.text "It is not yet put under quarantine"
    end
    pp.breakable
    super
    pp.breakable
    unless original_exceptions.include?(reason)
        reason.pretty_print(pp)
    end
end

#quarantined?Boolean

Returns:

  • (Boolean)


218
219
220
# File 'lib/roby/standard_errors.rb', line 218

def quarantined?
    !!@quarantined
end