aboutsummaryrefslogtreecommitdiffstats
path: root/lib/net
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/imap.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index 46e8f201a1..0f6a4372d5 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -307,9 +307,12 @@ module Net
end
rescue Errno::ENOTCONN
# ignore `Errno::ENOTCONN: Socket is not connected' on some platforms.
+ rescue Exception => e
+ @receiver_thread.raise(e)
end
@receiver_thread.join
@sock.close
+ raise e if e
end
# Returns true if disconnected from the server.
@@ -1012,7 +1015,10 @@ module Net
@client_thread = Thread.current
@receiver_thread = Thread.start {
- receive_responses
+ begin
+ receive_responses
+ rescue Exception
+ end
}
end