Exception: Roby::SynchronousEventProcessingMultipleErrors

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/roby/execution_engine.rb

Overview

Exception wrapper used to report that multiple errors have been raised during a synchronous event processing call.

See ExecutionEngine#process_events_synchronous for more information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ SynchronousEventProcessingMultipleErrors

Returns a new instance of SynchronousEventProcessingMultipleErrors.



21
22
23
24
25
# File 'lib/roby/execution_engine.rb', line 21

def initialize(errors)
    super()

    @errors = errors
end

Instance Attribute Details

#errorsArray<ExecutionEngine::PropagationInfo> (readonly)

Exceptions as gathered during propagation with ExecutionEngine#task_m



12
13
14
# File 'lib/roby/execution_engine.rb', line 12

def errors
  @errors
end

Instance Method Details

#original_exceptionsArray<Exception>

The set of underlying “real” (i.e. non-Roby) exceptions

Returns:



17
18
19
# File 'lib/roby/execution_engine.rb', line 17

def original_exceptions
    errors
end

#pretty_print(pp) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/roby/execution_engine.rb', line 27

def pretty_print(pp)
    pp.text "Got #{errors.size} exceptions and #{original_exceptions.size} sub-exceptions"
    pp.breakable
    pp.seplist(errors.each_with_index) do |e, i|
        Roby.flatten_exception(e).each_with_index do |sub_e, sub_i|
            pp.breakable
            pp.text "[#{i}.#{sub_i}] "
            sub_e.pretty_print(pp)
        end
    end
end