home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / tclX-6.4 / help / control / errorCode < prev    next >
Encoding:
Text File  |  1992-12-17  |  3.8 KB  |  67 lines

  1.           errorCode
  2.                After  an error has occurred, this variable will be set
  3.                to hold additional information about  the  error  in  a
  4.                form  that is easy to process with programs.  errorCode
  5.                consists of a Tcl list with one or more elements.   The
  6.                first element of the list identifies a general class of
  7.                errors, and determines the format of the  rest  of  the
  8.                list.   The following formats for errorCode are used by
  9.                the  Tcl  core;  individual  applications  may   define
  10.                additional formats.
  11.  
  12.                CHILDKILLED pid sigName msg
  13.                     This  format is used when a child process has been
  14.                     killed because of a signal.  The second element of
  15.                     errorCode  will  be  the  process's identifier (in
  16.                     decimal).  The third element will be the  symbolic
  17.                     name  of  the  signal  that  caused the process to
  18.                     terminate; it will be one of the  names  from  the
  19.                     include  file  signal.h,  such  as  SIGPIPE.   The
  20.                     fourth element  will  be  a  short  human-readable
  21.                     message  describing the signal, such as ``write on
  22.                     pipe with no readers'' for SIGPIPE.
  23.  
  24.                CHILDSTATUS pid code
  25.                     This  format  is  used  when  a  child process has
  26.                     exited with a non-zero exit  status.   The  second
  27.                     element   of   errorCode  will  be  the  process's
  28.                     identifier (in decimal) and the third element will
  29.                     be  the exit code returned by the process (also in
  30.                     decimal).
  31.  
  32.                CHILDSUSP pid code
  33.                     This  format is used when a child process has been
  34.                     suspended because of a signal.  The second element
  35.                     of  errorCode will be the process's identifier, in
  36.                     decimal.  The third element will be  the  symbolic
  37.                     name  of  the  signal  that  caused the process to
  38.                     suspend; this will be one of the  names  from  the
  39.                     include  file  signal.h,  such  as  SIGTTIN.   The
  40.                     fourth element  will  be  a  short  human-readable
  41.                     message    describing    the   signal,   such   as
  42.                     ``background tty read'' for SIGTTIN.
  43.  
  44.                NONE
  45.                     This format is used for errors where no additional
  46.                     information is available for an error besides  the
  47.                     message  returned  with the error.  In these cases
  48.                     errorCode will consist  of  a  list  containing  a
  49.                     single element whose contents are NONE.
  50.  
  51.                UNIX errName msg
  52.                     If  the  first  element of errorCode is UNIX, then
  53.                     the error occurred during a UNIX kernel call.  The
  54.                     second  element  of  the  list  will  contain  the
  55.                     symbolic name of the error that occurred, such  as
  56.                     ENOENT;  this will be one of the values defined in
  57.                     the include file errno.h.  The  third  element  of
  58.                     the   list   will   be  a  human-readable  message
  59.                     corresponding to errName, such as ``no  such  file
  60.                     or directory'' for the ENOENT case.
  61.  
  62.                To  set  errorCode,  applications  should  use  library
  63.                procedures  such as Tcl_SetErrorCode and Tcl_UnixError,
  64.                or they may invoke the error command.  If one of  these
  65.                methods hasn't been used, then the Tcl interpreter will
  66.                reset the variable to NONE after the next error.
  67.