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

Home » Public Forums » archive » Re: Error Handling Advice
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Error Handling Advice [message #82709 is a reply to message #82708] Mon, 14 January 2013 10:30 Go to previous messageGo to previous message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
Ok, I think I have reasoned with myself enough to know when to use ON_ERROR, 2 and when to use CATCH, but most CATCH blocks that I see just print an error message and return to the calling program, anyway, without doing anything special.

For example, take the following

-----------%<----------------
CATCH, Error_status

IF Error_status NE 0 THEN BEGIN
CATCH, /CANCEL
PRINT, 'Error index: ', Error_status
PRINT, 'Error message: ', !ERROR_STATE.MSG
RETURN
ENDIF
-----------%<----------------

Is there any reason for not using ON_ERROR, 2 in this case?

From what I gather, the CATCH blocks are normally used to make a program "fail gracefully", in that it resets the device and color table, closes files, frees pointers, etc. But without anything to reset, is ON_ERROR, 2 sufficient?

I guess I will start with some with trial and ::ehem:: error ;-)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Using function after .reset
Next Topic: Transparent and Overplotted Images with cgImage

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

Current Time: Sat Oct 11 18:01:27 PDT 2025

Total time taken to generate the page: 0.39916 seconds