eventmachine/eventmachine — Issue #291: Exception that occurs during signal handler is not trapped by error handler and crashes whole process
Author: paneq
Created: 2012-01-16 09:42:23+00:00
State: open

```ruby
EM.epoll
EM.synchrony do
EM.error_handler { |error| puts error }

trap("HUP") do
raise "X" # I was reloading configuration here but something went wrong
end
end
```

Output:

```
[10:31:32][rupert@scruffy: +1] ~/develop/server (master)
>> ./script/server
./script/server:73:in `block (2 levels) in

': X (RuntimeError)
from /home/rupert/.rvm/gems/ruby-1.9.2-p180-fastrequire/bundler/gems/eventmachine-69151c3ebb3e/lib/eventmachine.rb:186:in `call'
from /home/rupert/.rvm/gems/ruby-1.9.2-p180-fastrequire/bundler/gems/eventmachine-69151c3ebb3e/lib/eventmachine.rb:186:in `run_machine'
from /home/rupert/.rvm/gems/ruby-1.9.2-p180-fastrequire/bundler/gems/eventmachine-69151c3ebb3e/lib/eventmachine.rb:186:in `run'
from /home/rupert/.rvm/gems/ruby-1.9.2-p180-fastrequire/bundler/gems/em-synchrony-1827887371c6/lib/../lib/em-synchrony.rb:27:in `synchrony'
from ./script/server:55:in `

'
[10:32:45][rupert@scruffy: +1] ~/develop/server (master)
```

As you can see the reactor stopped working (process crashed). I hoped that such exception would get caught by `error_handler`.