fix flaky tnetconnect which sometimes failed with: No route to host [OSError] (#17526)
This commit is contained in:
parent
b1b767ed0d
commit
8ed6de4fe6
1 changed files with 3 additions and 2 deletions
|
|
@ -17,10 +17,11 @@ proc test() =
|
||||||
wrapSocket(ctx, socket)
|
wrapSocket(ctx, socket)
|
||||||
|
|
||||||
# trying 2 sites makes it more resilent: refs #17458 this could give:
|
# trying 2 sites makes it more resilent: refs #17458 this could give:
|
||||||
# Error: unhandled exception: Call to 'connect' timed out. [TimeoutError]
|
# * Call to 'connect' timed out. [TimeoutError]
|
||||||
|
# * No route to host [OSError]
|
||||||
try:
|
try:
|
||||||
fn("www.nim-lang.org")
|
fn("www.nim-lang.org")
|
||||||
except TimeoutError:
|
except TimeoutError, OSError:
|
||||||
fn("www.google.com")
|
fn("www.google.com")
|
||||||
|
|
||||||
test()
|
test()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue