Check #closed? instead of rescuing.

bug/bundler_fix
joev 2014-04-03 14:20:48 -05:00
parent 98628b814e
commit 42d59d269e
1 changed files with 1 additions and 8 deletions

View File

@ -198,14 +198,7 @@ class Client
def close
if (self.conn)
self.conn.shutdown
begin
self.conn.close
rescue IOError => e
# sometimes, the socket might already be closed, which will
# cause conn.close to raise an IOError. Since we just care
# about the socket closing itself here, we ignore the exception.
end
self.conn.close unless self.conn.closed?
end
self.conn = nil