File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
test/net/imap/fake_server Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
module Net ::IMAP ::FakeServer ::TestHelper
6
6
7
+ IO_ERRORS = [
8
+ IOError ,
9
+ EOFError ,
10
+ Errno ::ECONNABORTED ,
11
+ Errno ::ECONNRESET ,
12
+ Errno ::EPIPE ,
13
+ Errno ::ETIMEDOUT ,
14
+ ] . freeze
15
+
7
16
def run_fake_server_in_thread ( ignore_io_error : false ,
8
17
report_on_exception : true ,
9
18
timeout : 10 , **opts )
@@ -13,14 +22,14 @@ def run_fake_server_in_thread(ignore_io_error: false,
13
22
Thread . current . abort_on_exception = false
14
23
Thread . current . report_on_exception = report_on_exception
15
24
server . run
16
- rescue IOError
25
+ rescue * IO_ERRORS
17
26
raise unless ignore_io_error
18
27
end
19
28
yield server
20
29
ensure
21
30
begin
22
31
server &.shutdown
23
- rescue IOError
32
+ rescue * IO_ERRORS
24
33
raise unless ignore_io_error
25
34
end
26
35
end
You can’t perform that action at this time.
0 commit comments