minor: JRUBY hacks
This commit is contained in:
parent
746687bb86
commit
9b38c3a70f
|
@ -70,10 +70,14 @@ module Mongo
|
||||||
if ready
|
if ready
|
||||||
begin
|
begin
|
||||||
@socket.sysread(maxlen, buffer)
|
@socket.sysread(maxlen, buffer)
|
||||||
rescue Errno::ENOTCONN, Errno::EBADF, Errno::ECONNRESET, Errno::EPIPE, Errno::ETIMEDOUT, EOFError
|
rescue SystemCallError => ex
|
||||||
raise ConnectionFailure
|
# Needed because sometimes JRUBY doesn't throw Errno::ECONNRESET as it should
|
||||||
rescue Errno::EINTR, Errno::EIO, IOError
|
# http://jira.codehaus.org/browse/JRUBY-6180
|
||||||
raise OperationFailure
|
raise ConnectionFailure, ex
|
||||||
|
rescue Errno::ENOTCONN, Errno::EBADF, Errno::ECONNRESET, Errno::EPIPE, Errno::ETIMEDOUT, EOFError => ex
|
||||||
|
raise ConnectionFailure, ex
|
||||||
|
rescue Errno::EINTR, Errno::EIO, IOError => ex
|
||||||
|
raise OperationFailure, ex
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
raise OperationTimeout
|
raise OperationTimeout
|
||||||
|
|
Loading…
Reference in New Issue