I'm making a connection to several servers in my script and currently if one of them is down I get a ** Access Error: Network timeout error and the script stops. I'd rather be able to detect and move on instead of having it giving up altogether.

Is there a way to do this detection?

有帮助吗?

解决方案

For error handling use TRY and test the result:

>> err: try [read http://localhost]
** Access error: protocol error: "Timeout"

>> if all [error? err err/id = 'protocol err/arg1 = "Timeout"] ["Got a timeout."]
== "Got a timeout."
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top