Exception: Roby::ExceptionBase

Inherits:
RuntimeError
  • Object
show all
Includes:
DRoby::V5::ExceptionBaseDumper
Defined in:
lib/roby/standard_errors.rb,
lib/roby/droby/enable.rb

Overview

Base class for all Roby exceptions

Direct Known Subclasses

Aborting, LocalizedError

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DRoby::V5::ExceptionBaseDumper

#droby_dump

Methods included from DRoby::V5::Builtins::ExceptionDumper

#droby_dump

Constructor Details

#initialize(exceptions = Array.new) ⇒ ExceptionBase

Returns a new instance of ExceptionBase.



49
50
51
# File 'lib/roby/standard_errors.rb', line 49

def initialize(exceptions = Array.new)
    @original_exceptions = exceptions
end

Instance Attribute Details

#original_exceptionsArray<Exception>

List of Exception objects that caused this

Returns:



47
48
49
# File 'lib/roby/standard_errors.rb', line 47

def original_exceptions
  @original_exceptions
end

Instance Method Details

#each_original_exception(&block) ⇒ Object



53
54
55
# File 'lib/roby/standard_errors.rb', line 53

def each_original_exception(&block)
    @original_exceptions.each(&block)
end

#report_exceptions_from(object) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/roby/standard_errors.rb', line 57

def report_exceptions_from(object)
    if object.kind_of?(Exception)
        original_exceptions << object
    elsif object.respond_to?(:report_exceptions_on)
        object.report_exceptions_on(self)
    elsif object.respond_to?(:context) && object.context
        object.context.each do |c|
            report_exceptions_from(c)
        end
    elsif object.respond_to?(:failure_reason)
        report_exceptions_from(object.failure_reason)
    end
end