>  Docs Center  >  Libraries  >  Coyote  >  CGERRORMSG


  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. Otherwise, the error message is just printed to standard out.




    themessage: in, optional, type=string
      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.


    error: in, optional, type=boolean, default=1
      Set this keyword to cause Dialog_Message to use the ERROR reporting dialog.
      Note that a longstanding bug in IDL causes the ERROR dialog to be used whether
      this keyword is set to 0 or 1!
    informational: in, optional, type=boolean, default=0
      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!
    noname: in, optional, type=boolean, default=0
      Normally, the name of the routine in which the error occurs is prepended to the error
      message. Setting this keyword will suppress this behavior and no routine name will be used.
    quiet: in, optional, type=boolean, default=0
      Set this keyword to suppress the DIALOG_MESSAGE pop-up dialog.
    title: in, optional, type=string
      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: in, optional, type=boolean, default=1
        Setting this keyword results in an error traceback being printed to standard output with the
        PRINT command. Use TRACEBACK=0 to turn this functionality off.


  In general, the cgErrorMsg function is not called directly. Rather, it is used in a
  CATCH error handler. Errors are thrown to cgErrorMsg with the MESSAGE command. A typical
  CATCH error handler is shown below::
      Catch, theError
      IF theError NE 0 THEN BEGIN
          Catch, /Cancel
          void = cgErrorMsg()


  Error messages will get into the cgErrorMsg function by throwing an error with the
  MESSAGE command, like this::
      IF test NE 1 THEN Message, 'The test failed.'


      David W. Fanning
      1645 Sheely Drive
      Fort Collins, CO 80526 USA
      Phone: 970-221-0438
      E-mail: david@idlcoyote.com
      Coyote's Guide to IDL Programming: http://www.idlcoyote.com


    Change 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 check for window connection specifically for CRON jobs. 6 May 2008. DWF.
      Added QUIET keyword. 18 October 2008. DWF.
      The traceback information was bypassed when in the PostScript device. Not what I
        had in mind. Fixed. 6 July 2009. DWF.
      The QUIET keyword was clearing traceback information. Fixed with help from Phillip Bitzer. 2 Oct 2012. DWF.
      Name changed to cgErrorMsg from Error_Message, 4 November 2013, by David W. Fanning.


    Copyright (c) 2013, Fanning Software Consulting, Inc.

© 2020 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us