From b3a9d93096324de1ef99d638f7bf8142f8956ef2 Mon Sep 17 00:00:00 2001 From: Tyler Brock Date: Mon, 23 Apr 2012 16:58:11 -0400 Subject: [PATCH] RUBY-436 Handle IRB::Abort Exception --- lib/mongo/networking.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/mongo/networking.rb b/lib/mongo/networking.rb index 62cee62..97cc7ea 100644 --- a/lib/mongo/networking.rb +++ b/lib/mongo/networking.rb @@ -140,6 +140,11 @@ module Mongo rescue SystemStackError, NoMemoryError, SystemCallError => ex close raise ex + rescue Exception => ex + if defined?(IRB) + close if ex.class == IRB::Abort + end + raise ex ensure if should_checkin if command || read == :primary