diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-21 08:48:32 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-21 08:48:32 +0000 |
commit | acb10b8c32a7235b56e4f4346e8ed6bf5026166a (patch) | |
tree | dd65a32015ad134f0f4fed5f5a193e9c1c6f7ed4 /test/net/ftp/test_ftp.rb | |
parent | e7ce7713545f06b33f020abb6b064283c78bbc92 (diff) | |
download | ruby-acb10b8c32a7235b56e4f4346e8ed6bf5026166a.tar.gz |
Rescue exception from writing to a socket.
conn.print may raise EPIPE because ftp.retrbinary closes the connection
because of read_timeout. but the exact result varies from the situation
like platform, timing, and so on.
it may raise ECONNRESET, ECONNABORTED, EOFError, or nothing raised.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net/ftp/test_ftp.rb')
-rw-r--r-- | test/net/ftp/test_ftp.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb index a3a08c67b2..db28e8ce35 100644 --- a/test/net/ftp/test_ftp.rb +++ b/test/net/ftp/test_ftp.rb @@ -392,7 +392,7 @@ class FTPTest < Test::Unit::TestCase sleep(0.1) conn.print(binary_data[0,1024]) sleep(0.5) - assert_raise(Errno::EPIPE){ conn.print(binary_data[1024, 1024]) } + conn.print(binary_data[1024, 1024]) rescue nil # may raise EPIPE or something conn.close sock.print("226 Transfer complete.\r\n") } |