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.



214
215
216
217
218
219
220
# File 'lib/roby/standard_errors.rb', line 214

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.



208
209
210
# File 'lib/roby/standard_errors.rb', line 208

def reason
  @reason
end

Instance Method Details

#pretty_print(pp) ⇒ Object



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/roby/standard_errors.rb', line 222

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
    if !original_exceptions.include?(reason)
        reason.pretty_print(pp)
    end
end

#quarantined?Boolean

Returns:

  • (Boolean)


210
211
212
# File 'lib/roby/standard_errors.rb', line 210

def quarantined?
    !!@quarantined
end