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 = []) ⇒ ExceptionBase

Returns a new instance of ExceptionBase.



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

def initialize(exceptions = [])
    super()

    @original_exceptions = exceptions
end

Instance Attribute Details

#original_exceptionsArray<Exception>

List of Exception objects that caused this

Returns:



51
52
53
# File 'lib/roby/standard_errors.rb', line 51

def original_exceptions
  @original_exceptions
end

Instance Method Details

#each_original_exception(&block) ⇒ Object



59
60
61
# File 'lib/roby/standard_errors.rb', line 59

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

#report_exceptions_from(object) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/roby/standard_errors.rb', line 63

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