igrigorik/em-synchrony — pull request #71 by qqshfox (2011-10-24 11:03:35+00:00)
Title: fix mysql2 defer logic

related to igrigorik/em-synchrony#69

origin codes in mysql2 is:

```ruby
def notify_readable
detach
begin
@deferable.succeed(@client.async_result)
rescue Exception => e
@deferable.fail(e)
end
end
```
Exception throwed in callback will be catched, and then the errback will be called.

The async query method will new a defer, and add a callback and a errback into the chain:

```ruby
def query(sql, opts={})
deferable = aquery(sql, opts)

f = Fiber.current
deferable.callback { |res| f.resume(res) } # *1
deferable.errback { |err| f.resume(err) } # *2

Fiber.yield.tap do |result|
raise result if result.is_a?(::Exception)
end
end
```
*1 if exception thrown here
*2 the errback will be called, and fiber dead :(
So the fix is: only catch the exception from async_result.