Re: CATCH error problem [message #65999] |
Wed, 08 April 2009 09:21  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
David Fanning wrote:
> lbusett@yahoo.it writes:
>
>> The first time that an error in data transfer occurs, the "catch"
>> procedure kicks in correctly, the counter is incremented and another
>> attempt is made. However, if another data transfer error occurs the
>> CATCH procedure does not kick in any more, and the program exits with
>> an error.
>>
>> Does anyone know why is it happening ? Is there a "smarter" way to do
>> the job ?
>
> You are cancelling the CATCH in the first line of
> the CATCH error handler. If you want CATCH to
> remain in effect, don't do this. :-)
>
> Cheers,
>
> David
>
> P.S. Just be sure your error handling code is correct
> *before* you take that CANCEL out! :-)
>
Yes, but I'm never confident enough to take that CANCEL out, so what I
usually end up doing is writing a separate wrapper routine around the
request and giving that wrapper routine an ERROR keyword. In that
wrapper routine, the CATCH block sets ERROR=1. Then in the original
routine, I can call the wrapper and not have to worry that it will have
a runtime error, I can just check the ERROR keyword.
I just get worried when the logic in the CATCH block starts to get
complicated.
Mike
--
www.michaelgalloy.com
Associate Research Scientist
Tech-X Corporation
|
|
|
|
Re: CATCH error problem [message #66069 is a reply to message #66000] |
Fri, 10 April 2009 03:11  |
lbusett@yahoo.it
Messages: 30 Registered: February 2006
|
Member |
|
|
Doh !
Next time I will read the documentation more accurately before
posting... I thought that the CANCEL keyword was simply resetting the
error state to 0, and not cancelling the CATCH procedure...
Thanks for the help,
Lorenzo
|
|
|