From 70777b3fa87d6c0aefb0f072b68e7b792a9e63f3 Mon Sep 17 00:00:00 2001 From: shugo Date: Thu, 12 Jan 2017 02:19:17 +0000 Subject: lib/net/protocol.rb: preserve backtrace information BufferedIO#rbuf_fill should preserve backtrace information when raising EOFError. Otherwise, users get confused when EOFError is leaked out from Net::SMTP etc. [ruby-core:78550] [Bug #13018] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/net/protocol.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb index 1ea7f6bfc3..518b92c4ab 100644 --- a/lib/net/protocol.rb +++ b/lib/net/protocol.rb @@ -181,8 +181,7 @@ module Net # :nodoc: @io.to_io.wait_writable(@read_timeout) or raise Net::ReadTimeout # continue looping when nil - # callers do not care about backtrace, so avoid allocating for it - raise EOFError, 'end of file reached', [] + raise EOFError, 'end of file reached' end while true end -- cgit v1.2.3