Re: ERROR_MESSAGE [message #77794] |
Fri, 23 September 2011 00:57 |
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  |
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).
|
|
|