comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: CATCH error problem
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: CATCH error problem [message #65999] Wed, 08 April 2009 09:21 Go to next message
Michael Galloy is currently offline  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 #66000 is a reply to message #65999] Wed, 08 April 2009 08:33 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
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! :-)

--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: CATCH error problem [message #66069 is a reply to message #66000] Fri, 10 April 2009 03:11 Go to previous message
lbusett@yahoo.it is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: ENVI_INIT_TILE tiling problem
Next Topic: ENVI_INIT_TILE tiling problem

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:41:48 PDT 2025

Total time taken to generate the page: 0.00587 seconds