From 58f0ee8ffff85b91053170ed9087d85db4f3c031 Mon Sep 17 00:00:00 2001 From: Tyler Brock Date: Wed, 4 Apr 2012 20:12:36 -0400 Subject: [PATCH] RUBY-429 rescue granularity --- lib/mongo/util/tcp_socket.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/mongo/util/tcp_socket.rb b/lib/mongo/util/tcp_socket.rb index f312095..bfbb281 100644 --- a/lib/mongo/util/tcp_socket.rb +++ b/lib/mongo/util/tcp_socket.rb @@ -65,9 +65,10 @@ module Mongo @socket.readpartial(maxlen, buffer) rescue EOFError return ConnectionError - rescue Errno::ECONNRESET, Errno::EPIPE, Errno::EINVAL, Errno::EBADF, Errno::EINTR, - Errno::EIO, Errno::ENOTCONN, SocketError - raise ConnectionFailure + rescue Errno::ECONNRESET, Errno::ENOTCONN, Errno::EBADF + raise ConnectionFailure + rescue Errno::EINTR, Errno::EIO, Errno::EPIPE + raise OperationFailure end else raise OperationTimeout