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

Home » Public Forums » archive » Re: ERROR_MESSAGE
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: ERROR_MESSAGE [message #77794] Fri, 23 September 2011 00:57
Allard de Wit is currently offline  Allard de Wit
Messages: 7
Registered: December 2002
Junior Member
Dear Wayne,

The solution is to put a RETALL or RETURN inside the error handler:

Catch, error_status
IF error_status NE 0 THEN BEGIN
Catch, /CANCEL
void = Error_Message()
RETURN
ENDIF

This will get you out of the offending routine with all the pop-ups
and still get you the traceback information that you want. Depending
on what the program does with the error, you may even want to replace
the RETURN statement with a "Message, /REISSUE_LAST" to propagate the
error up to an error handler at a higher level.

Allard
Re: ERROR_MESSAGE [message #77795 is a reply to message #77794] Thu, 22 September 2011 16:41 Go to previous message
Bob[4] is currently offline  Bob[4]
Messages: 24
Registered: April 2009
Junior Member
I too have been burned by this and am curious if there is a nice solution. Sometimes I've had to kill the idl session to get out of it. For this reason and the fact that I almost always want to check some variables where the error occurred, I prefer using the default (on_error, 0) error handling to actually catching them. Catching the error is disorienting and make it harder to find the error. In big libraries (e.g. cg) it would be great if setting a system variable would switch from the catch method to the on_error method (probably using on_error, 2 since it is a library).
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ERROR_MESSAGE
Next Topic: Re: Issues with cgColorbar labels

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

Current Time: Wed Oct 08 17:36:25 PDT 2025

Total time taken to generate the page: 0.00471 seconds