lib/em-synchrony/em-mysqlplus.rb in em-synchrony-0.1.5 vs lib/em-synchrony/em-mysqlplus.rb in em-synchrony-0.2.0
- old
+ new
@@ -1,9 +1,10 @@
begin
+ require "mysqlplus"
require "em-mysqlplus"
rescue LoadError => error
- raise "Missing EM-Synchrony dependency: gem install em-mysqlplus"
+ raise "Missing EM-Synchrony dependency: gem install mysqlplus, gem install em-mysqlplus"
end
module EventMachine
class MySQL
@@ -15,10 +16,12 @@
cb = Proc.new { |r| f.resume(r) }
eb = Proc.new { |r| f.resume(r) }
@connection.execute(sql, cb, eb)
- Fiber.yield
+ result = Fiber.yield
+ raise result if Mysql::Error == result.class
+ result
end
end
end