Module: Roby::Interface::GatherExceptions

Defined in:
lib/roby/interface.rb

Instance Method Summary collapse

Instance Method Details

#fatal_exception(error, tasks) ⇒ Object

Pushes an exception information on all remote interfaces connected to us



187
188
189
190
# File 'lib/roby/interface.rb', line 187

def fatal_exception(error, tasks)
    super if defined? super
    push_exception_message("fatal exception", error, tasks)
end

#handled_exception(error, task) ⇒ Object

Pushes an exception information on all remote interfaces connected to us



181
182
183
184
# File 'lib/roby/interface.rb', line 181

def handled_exception(error, task)
    super if defined? super
    push_exception_message("exception", error, [task])
end

#push_exception_message(name, error, tasks) ⇒ Object

Pushes a exception message to all the already registered remote interfaces.



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/roby/interface.rb', line 161

def push_exception_message(name, error, tasks)
    Roby::Control.synchronize do
               msg = Roby.format_exception(error.exception).join("\n")
 msg << "\nThe following tasks have been killed:\n"
 tasks.each do |t|
                   msg << "  "
                   if error.exception.involved_plan_object?(t)
                       msg << "#{t.class}:0x#{t.address.to_s(16)}\n"
                   else
                       PP.pp(t, msg)
                   end
               end

 interfaces.each do |iface|
      iface.pending_messages << msg
 end
    end
end

#register_interface(iface) ⇒ Object

Register a new Interface object so that it gets feedback information from the running controller.



154
155
156
157
158
# File 'lib/roby/interface.rb', line 154

def register_interface(iface)
    Roby::Control.synchronize do
 interfaces << iface
    end
end