EventMachine-LE icon indicating copy to clipboard operation
EventMachine-LE copied to clipboard

error_handler not called for deferred errors

Open quezacoatl opened this issue 11 years ago • 1 comments

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.

quezacoatl avatar Sep 24 '14 06:09 quezacoatl

Indeed.

ibc avatar Jul 01 '15 13:07 ibc