Question

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?

Was it helpful?

Solution

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."
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top