MESSAGE facility [message #8775] |
Tue, 22 April 1997 00:00  |
Wayne Landsman
Messages: 117 Registered: January 1997
|
Senior Member |
|
|
I'm not sure if it is appropriate yet to discuss IDL V5.0, which is
still in beta release, but this can be considered a general (and minor)
question about the philosphy of error reporting.
One change in IDL V5.0 is that the default response of the MESSAGE
facility is now to include a traceback. At least, as of V5.0B5 there
is no way to suppress this response, e.g. there is no /NOTRACEBACK
keyword. This can lead to the following disconcerting behavior. A
function call that in V4.0.1 yields the following response:
IDL> a = dbfind('dec>0')
% DB_INFO: No data base file(s) opened
becomes in V5.0B5
STIS>a = dbfind('dec>0')
% DB_INFO: No data base file(s) opened
% Error occurred at: DB_INFO 112/share/idl/astro_util/db_info.pro
% DBFIND 137/share/idl/astro_util/dbfind.pro
% $MAIN$
% Execution halted at:$MAIN$
Now in the IDL V4.0.1 case, everything seems to be under control -- the
program is correctly exiting because I have not opened a database before
calling DBFIND(). But whenever I see a traceback, as in the V5.0B5
case, my first impulse is to think that the software is broken. In one
sense, the software *is* broken, but the error is at the MAIN level in
the parameters entered at the terminal by the user. Of course,
DBFIND() isn't necessarily going to be called directly by the user, and
if there is a real software bug, then it is important to have a
traceback. So I'm not sure if I should (1) get used to always seeing
a traceback or (2) not use the MESSAGE facility if the error is likely
to be incorrect parameters entered by the user. Any comments?
Wayne Landsman landsman@mpb.gsfc.nasa.gov
|
|
|
Re: MESSAGE facility [message #8841 is a reply to message #8775] |
Thu, 24 April 1997 00:00  |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
Wayne Landsman <landsman@mpb.gsfc.nasa.gov> writes:
> I'm not sure if it is appropriate yet to discuss IDL V5.0, which is
> still in beta release, but this can be considered a general (and minor)
> question about the philosphy of error reporting.
> One change in IDL V5.0 is that the default response of the MESSAGE
> facility is now to include a traceback. At least, as of V5.0B5 there
> is no way to suppress this response, e.g. there is no /NOTRACEBACK
> keyword. This can lead to the following disconcerting behavior. A
> function call that in V4.0.1 yields the following response:
> IDL> a = dbfind('dec>0')
> % DB_INFO: No data base file(s) opened
> becomes in V5.0B5
> STIS>a = dbfind('dec>0')
> % DB_INFO: No data base file(s) opened
> % Error occurred at: DB_INFO 112/share/idl/astro_util/db_info.pro
> % DBFIND 137/share/idl/astro_util/dbfind.pro
> % $MAIN$
> % Execution halted at:$MAIN$
There are three ways I'm aware of that the MESSAGE function can be called:
1. Without any keywords.
2. With the keyword /CONTINUE.
3. With the keyword /INFORMATIONAL. (Like /CONTINUE, but messages are not
printed if !QUIET=1.)
Checking the source of db_info.pro, I see that it uses no keywords in the call
to MESSAGE. Printing a traceback as a default seems to be quite a reasonable
thing to do in this case. However, I'd be very disappointed if a traceback was
printed in the other two cases--that could cause me to stop using MESSAGE.
What does IDL v5 do in those cases?
I notice that the online documentation for MESSAGE in IDL v3.6 includes the
keyword TRACEBACK. (The online doc in version 4 is much less informative.)
Have you tried
MESSAGE, 'No data base file(s) opened', TRACEBACK=0
I agree that there should be some mechanism for turning off the trackback.
Bill Thompson
|
|
|