Re: Error handling and tracebacks [message #40114 is a reply to message #40112] |
Wed, 21 July 2004 21:52   |
Michael Wallace
Messages: 409 Registered: December 2003
|
Senior Member |
|
|
>> How do I disable tracebacks associated with the message procedure?
>
>
> My goodness, you are having a tough day, today. :-)
>
It's not very often you get two IDL questions from completely different
ends of the spectrum at the same time on the same day, but it happens.
Oh, well. Part of the business, I suppose. :-)
> 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 played with catching the error some, but I really didn't like results
too much. I just don't have enough time to play with things. Really,
the problem is of no concern to me, but it seems that I'm going to have
to go on an end user education project. The problem is that some people
using my stuff are too quick to think that a bug has come up in my code.
When they see the traceback, 9 times out of 10, they don't even look
at the message I put out at the top because they think that some crazy
bug caused something screwy to happen. (Almost all of my IDL programs
are on the command line, BTW) Invariably, they have simply mistyped
something in the call into my code.
In short, I thought I might rid myself of this dilemma if I could
somehow show them the error message with no trace. This is more
*normal* to them and as such they'd actually *read* the error message
like they should have in the first place.
Sigh.
> I don't have any idea what the PRUNE procedure
> might look like. :-(
Might it look like the PLUM procedure after having sat out in the sun
too long?
-Mike
|
|
|