home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / IDE / SUBARTIC / SUB_ARCT / LIB / SUB_ARCT.JAV < prev    next >
Encoding:
Text File  |  1996-10-04  |  2.4 KB  |  71 lines

  1. package sub_arctic.lib;
  2.  
  3. /**
  4.  * This class is the only throwable object used by the sub_arctic 
  5.  * infrastructure.  This class is derived from java.lang.Error so one need
  6.  * no declare it in the <B>throws</B> clause of methods or 
  7.  * always catch it.  <P>
  8.  * 
  9.  * Originally, sub_arctic had many times of exceptions (not errors)
  10.  * which were all derived from an exception called general.
  11.  * This proved problematic in early use of sub_arctic and was taken
  12.  * out before the public release. The main difficulty was that
  13.  * all of the system's exceptions were not really recoverable, but
  14.  * rather it was always the case that user code simply detected
  15.  * the problem an exited. Thus, it was nothing but an annoyance to
  16.  * be declaring these exceptions everywhere and catching them, so
  17.  * the whole mechanism was removed and replaced with the current one.
  18.  *
  19.  * @author Ian Smith
  20.  */
  21.  
  22. public class sub_arctic_error extends Error {
  23.   /**
  24.    * Construct a new sub_arctic_error with a string. This should only
  25.    * be done when an abnormal and basically fatal error occurs.
  26.    * @param String errmsg the error message detailing the problem that occurred
  27.    */
  28.   public sub_arctic_error(String errmsg) {
  29.     super(errmsg);
  30.   }
  31.   /** 
  32.    * Print a stack trace and exit with non-zero status value. 
  33.    */
  34.   public void crash() {
  35.     printStackTrace(System.err);
  36.     System.exit(1);
  37.   }
  38.   /** 
  39.    * Print a stack trace and exit with the given status value. 
  40.    * @param int code the status value to pass to exit().
  41.    */
  42.   public void crash(int code) {
  43.     printStackTrace(System.err);
  44.     System.exit(code);
  45.   }
  46.   /**
  47.    * Create a new sub_arctic_error with no string message. This is
  48.    * probably only useful when you are just creating the error
  49.    * for the purpose of calling some method on it.
  50.    */
  51.   public sub_arctic_error() {
  52.     super();
  53.   }
  54. }
  55. /*=========================== COPYRIGHT NOTICE ===========================
  56.  
  57. This file is part of the subArctic user interface toolkit.
  58.  
  59. Copyright (c) 1996 Scott Hudson and Ian Smith
  60. All rights reserved.
  61.  
  62. The subArctic system is freely available for most uses under the terms
  63. and conditions described in 
  64.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  65. and appearing in full in the lib/interactor.java source file.
  66.  
  67. The current release and additional information about this software can be 
  68. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  69.  
  70. ========================================================================*/
  71.