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

Home » Public Forums » archive » Consensus on error handling with DLMs
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: Consensus on error handling with DLMs [message #24918 is a reply to message #24838] Fri, 27 April 2001 06:57 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Paul van Delst (paul.vandelst@noaa.gov) writes:

> p.s. I only turn this error checking on *after* debugging though - if code crashes I want
> to know the line number i crashed at rather than always returning with a failure.

You might want to try my ERROR_MESSAGE routine. It was
designed *exactly* for this reason. I wanted sensible
error handling *AND* I wanted traceback information
to tell me the line number of the error:

http://www.dfanning.com/programs/error_message.pro

All of your code will remain the same, and your CATCH
error handler, which previously looked liked this:

CATCH, error_status
IF ( error_status NE 0 ) THEN BEGIN
CATCH, /CANCEL
MESSAGE, !ERROR_STATE.MSG, /CONTINUE
RETURN, FAILURE
ENDIF

Will now look like this:

CATCH, error_status
IF ( error_status NE 0 ) THEN BEGIN
CATCH, /CANCEL
ok = ERROR_MESSAGE(/Traceback)
RETURN, FAILURE
ENDIF

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: AAARGH!!! IDL5.2 crashes with CALL_EXTERNAL
Next Topic: subtle but important

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

Current Time: Fri Oct 10 00:33:40 PDT 2025

Total time taken to generate the page: 1.12249 seconds