edu.unh.sdb.common
Class SDBError

java.lang.Object
  extended by edu.unh.sdb.common.SDBError
Direct Known Subclasses:
BoundsError, DimensionalityError, FileError, IllegalArgumentError, InternalFaultError, MetaDataBaseError, XMLReaderError

public class SDBError
extends java.lang.Object


Field Summary
static int AlwaysThrow
           
protected  SDBException exceptionObject
           
static int Fatal
           
static int NeverThrow
           
static int Recoverable
           
protected  int throwerIndex
           
static int ThrowFatalOnly
           
static int Warning
           
 
Constructor Summary
protected SDBError(int errorLevel, SDBException sdbex)
          Constructor sets the error level for a particular error instance.
  SDBError(int errorLevel, java.lang.String message)
          Constructor sets the error level for a particular error instance.
 
Method Summary
static int getErrorReportingLevel()
           
protected  void logError(SDBException sdbex)
          Log the error message.
static void setErrorReportingLevel(int level)
          The Error Reporting Level determines when to raise an exception for an error.
protected  boolean shouldThrowException()
          Returns true if this instance of SDBError should throw an exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AlwaysThrow

public static final int AlwaysThrow
See Also:
Constant Field Values

ThrowFatalOnly

public static final int ThrowFatalOnly
See Also:
Constant Field Values

NeverThrow

public static final int NeverThrow
See Also:
Constant Field Values

Fatal

public static final int Fatal
See Also:
Constant Field Values

Recoverable

public static final int Recoverable
See Also:
Constant Field Values

Warning

public static final int Warning
See Also:
Constant Field Values

exceptionObject

protected SDBException exceptionObject

throwerIndex

protected int throwerIndex
Constructor Detail

SDBError

public SDBError(int errorLevel,
                java.lang.String message)
Constructor sets the error level for a particular error instance. and takes the message to be used in the throw


SDBError

protected SDBError(int errorLevel,
                   SDBException sdbex)
Constructor sets the error level for a particular error instance.

Method Detail

setErrorReportingLevel

public static void setErrorReportingLevel(int level)
The Error Reporting Level determines when to raise an exception for an error. Currently, the choices are AlwaysThrow, ThrowFatalOnly, or NeverThrow. If ThrowFatalOnly is used, then only fatal errors generate exceptions. The other two choices should be self explanatory.


getErrorReportingLevel

public static int getErrorReportingLevel()

shouldThrowException

protected boolean shouldThrowException()
Returns true if this instance of SDBError should throw an exception. Returns false otherwise.


logError

protected void logError(SDBException sdbex)
Log the error message. This should really be controlled by global logging status information. For now, we just write to standard error.