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

Home » Public Forums » archive » Re: Error handling and tracebacks
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 and tracebacks [message #40117 is a reply to message #40114] Wed, 21 July 2004 16:26 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Michael Wallace writes:

> How do I disable tracebacks associated with the message procedure?

My goodness, you are having a tough day, today. :-)

> Before the programming gurus yell at me for potentially hiding bugs my
> code, let me explain why I want to do this. I have a library of
> procedures and in certain cases I am creating my own errors via message
> which are several calls down in the stack. When the error comes out,
> there is a long traceback, but I only want the end user to see the
> message itself and not the entire traceback since the traceback is going
> several layers down into code that the end user shouldn't even be aware
> of. I do want the user to see the error, but not all the files and line
> numbers.

I think your only hope here is to CATCH the errors
thrown by MESSAGE yourself, then prune the error traceback
(which you maybe save in a string variable, with the OUTPUT
keyword) and pass it on to the user:

Catch, theError
IF theErron NE 0 THEN BEGIN
Help, /Traceback, Output=helpString
Prune, helpString
Print, helpString
ENDIF

I don't have any idea what the PRUNE procedure
might look like. :-(

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Error handling and tracebacks
Next Topic: ENVI: auto_wid_mng

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

Current Time: Fri Oct 10 19:34:30 PDT 2025

Total time taken to generate the page: 0.87782 seconds