sub_arctic.lib
Class sub_arctic_error

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Error
              |
              +--sub_arctic.lib.sub_arctic_error
Direct Known Subclasses:
stack_trace

public class sub_arctic_error
extends java.lang.Error

This class is the only throwable object used by the sub_arctic infrastructure. This class is derived from java.lang.Error so one need no declare it in the throws clause of methods or always catch it.

Originally, sub_arctic had many times of exceptions (not errors) which were all derived from an exception called general. This proved problematic in early use of sub_arctic and was taken out before the public release. The main difficulty was that all of the system's exceptions were not really recoverable, but rather it was always the case that user code simply detected the problem an exited. Thus, it was nothing but an annoyance to be declaring these exceptions everywhere and catching them, so the whole mechanism was removed and replaced with the current one.

See Also:
Serialized Form

Constructor Summary
sub_arctic_error()
          Create a new sub_arctic_error with no string message.
sub_arctic_error(java.lang.String errmsg)
          Construct a new sub_arctic_error with a string.
 
Method Summary
 void crash()
          Print a stack trace and exit with non-zero status value.
 void crash(int code)
          Print a stack trace and exit with the given status value.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

sub_arctic_error

public sub_arctic_error(java.lang.String errmsg)
Construct a new sub_arctic_error with a string. This should only be done when an abnormal and basically fatal error occurs.
Parameters:
String - errmsg the error message detailing the problem that occurred

sub_arctic_error

public sub_arctic_error()
Create a new sub_arctic_error with no string message. This is probably only useful when you are just creating the error for the purpose of calling some method on it.
Method Detail

crash

public void crash()
Print a stack trace and exit with non-zero status value.

crash

public void crash(int code)
Print a stack trace and exit with the given status value.
Parameters:
int - code the status value to pass to exit().