Hi Ryan
The key is to make sure that the try block is is only evaluating the read url
action and not find read.
The more you can narrow what an error try block is testing, the better you can
respond/identify to any errors.
REBOL []
secure none
sites: [
http://www.news.com/
http://www.herring.com/
http://www.slashdot.org/
http://www.rebol.com/
]
foreach url sites [
either error? try [page: read url][
print ["Error Reading (Possible Timeout)" url]
][
either found? (find page "REBOL") [
print ["Found mention of REBOL at" url]
][
print ["no mention of REBOL at" url]
]
]
]
Cheers
Allen K
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, November 21, 1999 1:22 AM
Subject: [REBOL] network timeout
> How can I avoid getting the following error in REBOL?
>
> Access Error: Network timeout.
>
> Below is the meat of the script I am running. I have already used an
> error? statement to try to eliminate this problem. The script first
> verfies it can connect to a server before trying to read the index page
> on the server. Is there anything more I can do to prevent the script
> from stopping on an access error? My real script has about 500 urls in
> the site: block and it is a real pain when the script stops running
> because of an access error.
>
> Thanks.
>
> -Ryan
>
>
> ;--- webfinder.r variation ---
>
>
> REBOL [
> Title: "Search Multiple Web Pages"
> File: %webfinder.r
> Date: 20-May-1999
> Purpose: {
> Search multiple web pages for a string, and print
> the URL of the ones where it was found.
> }
> ]
>
> secure none
>
> sites: [
> http://www.news.com/
> http://www.herring.com/
> http://www.slashdot.org/
>
> ]
>
> foreach url sites [
> either error? try [find read url "REBOL"] [next url] [either find
> read url "REBOL" [print "FOUND mention of REBOL"] [print "no mention of
> REBOL"]]
> ]
>
>