Newbie error handling question
[1/2] from: kpeters::vu-ware::com at: 28-Apr-2005 12:06
Hi list ~
how can I employ some error handling so that I get retries if a get in the loop
should fail?
As always, thanks in advance,
Kai
foreach url urllist [
counter: counter + 1
write to-file append copy "file" counter read url
]
[2/2] from: hallvard::ystad::oops-as::no at: 28-Apr-2005 21:34
Kai,
This depends on what you mean by retries...
Here's a quick solution:
foreach url urllist [
either error? error: try [ content: read url ] [
; register which url and schedule for retry
; maybe print mold disarm error to see why 'read
failed?
] [
counter: counter + 1
write to-file append copy "file" counter content
]
]
HY
Dixit Kai Peters <[kpeters--vu-ware--com]> (Thu, 28 Apr 2005
12:06:20 -0700):