Documentation for /home/davin/idl/socware/

Generated by IDLdoc

single page | use frames     summary     class     fields     routine details     file attributes

spedas/gui/utilities/

error_message.pro


NAME: ERROR_MESSAGE PURPOSE: The purpose of this function is to have a device-independent error messaging function. The error message is reported to the user by using DIALOG_MESSAGE if widgets are supported and MESSAGE otherwise. In general, the ERROR_MESSAGE function is not called directly. Rather, it is used in a CATCH error handler. Errors are thrown to ERROR_MESSAGE with the MESSAGE command. A typical CATCH error handler is shown below. Catch, theError IF theError NE 0 THEN BEGIN Catch, /Cancel ok = Error_Message(/Traceback, /Error) RETURN ENDIF Error messages would get into the ERROR_MESSAGE function by throwing an error with the MESSAGE command, like this: IF test NE 1 THEN Message, 'The test failed.' AUTHOR: FANNING SOFTWARE CONSULTING David Fanning, Ph.D. 1645 Sheely Drive Fort Collins, CO 80526 USA Phone: 970-221-0438 E-mail: davidf@dfanning.com Coyote's Guide to IDL Programming: http://www.dfanning.com/ CATEGORY: Utility. CALLING SEQUENCE: ok = Error_Message(the_Error_Message) INPUTS: the_Error_Message: This is a string argument containing the error message you want reported. If undefined, this variable is set to the string in the !Error_State.Msg system variable. KEYWORDS: ERROR: Set this keyword to cause Dialog_Message to use the ERROR reporting dialog. Note that a bug in IDL causes the ERROR dialog to be used whether this keyword is set to 0 or 1! INFORMATIONAL: Set this keyword to cause Dialog_Message to use the INFORMATION dialog instead of the WARNING dialog. Note that a bug in IDL causes the ERROR dialog to be used if this keyword is set to 0! TITLE: Set this keyword to the title of the DIALOG_MESSAGE window. By default the keyword is set to 'System Error' unless !ERROR_STATE.NAME equals "IDL_M_USER_ERR", in which case it is set to "Trapped Error'. TRACEBACK: Setting this keyword results in an error traceback being printed to standard output with the PRINT command. Set to 1 (ON) by default. Use TRACEBACK=0 to turn this functionality off. OUTPUTS: Currently the only output from the function is the string "OK". RESTRICTIONS: The WARNING Dialog_Message dialog is used by default. EXAMPLE: To handle an undefined variable error: IF N_Elements(variable) EQ 0 THEN $ ok = Error_Message('Variable is undefined', /Traceback) NOTES: This version has a systen variable called !GUIDEBUG that has been added for usage with the SPEDAS GUI, it is used to disable windowing with this error routine. If !GUIDEBUG = 1 this routine will only print to command line. To set GUIDEBUG call: defsysv,'!GUIDEBUG',1 MODIFICATION HISTORY: Written by: David W. Fanning, 27 April 1999. Added the calling routine's name in the message and NoName keyword. 31 Jan 2000. DWF. Added _Extra keyword. 10 February 2000. DWF. Forgot to add _Extra everywhere. Fixed for MAIN errors. 8 AUG 2000. DWF. Adding call routine's name to Traceback Report. 8 AUG 2000. DWF. Added ERROR, INFORMATIONAL, and TITLE keywords. 19 SEP 2002. DWF. Removed the requirement that you use the NONAME keyword with the MESSAGE command when generating user-trapped errors. 19 SEP 2002. DWF. Added distinctions between trapped errors (errors generated with the MESSAGE command) and IDL system errors. Note that if you call ERROR_MESSAGE directly, then the state of the !ERROR_STATE.NAME variable is set to the *last* error generated. It is better to access ERROR_MESSAGE indirectly in a Catch error handler from the MESSAGE command. 19 SEP 2002. DWF. Change on 19 SEP 2002 to eliminate NONAME requirement did not apply to object methods. Fixed program to also handle messages from object methods. 30 JULY 2003. DWF. Removed obsolete STR_SEP and replaced with STRSPLIT. 27 Oct 2004. DWF. Made a traceback the default case without setting TRACEBACK keyword. 19 Nov 2004. DWF. Added !GUIDEBUG keyword support. Patrick Cruce 2008-09-17

Routines

top source ERROR_MESSAGE

result = ERROR_MESSAGE(theMessage, Error=Error, Informational=Informational, Traceback=Traceback, NoName=NoName, Title=Title, _Extra=_Extra)

Parameters

theMessage

Keywords

Error
Informational
Traceback
NoName
Title
_Extra

File attributes

Modification date: Thu Feb 13 16:41:47 2014
Lines: 77