EventMachine-LE
EventMachine-LE copied to clipboard
error_handler not called for deferred errors
I think the error_handler should be called in the following case:
require 'eventmachine-le'
EM.run do
EM.error_handler { |e|
puts "Error raised during event loop: #{e.message}"
}
operation = proc {
raise 'some error'
}
callback = proc {
puts 'callback'
}
EM.defer operation, callback
end
Output is:
em_test.rb:10:in block (2 levels) in <main>': some error (RuntimeError) from /home/quezacoatl/.rvm/gems/ruby-2.1.2/gems/eventmachine-le-1.1.6/lib/eventmachine.rb:1067:incall'
from /home/quezacoatl/.rvm/gems/ruby-2.1.2/gems/eventmachine-le-1.1.6/lib/eventmachine.rb:1067:in `block in spawn_threadpool'
EM-loop is terminated.
Indeed.