chemaxon.util
Class ErrorHandler

java.lang.Object
  extended by chemaxon.util.ErrorHandler
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ConnectionHandler, JChemSearch, MolHandler, UpdateHandler

public abstract class ErrorHandler
extends java.lang.Object
implements java.io.Serializable

An abstract ancestor of JavaBeans that enable exception handling in different environments.

Inheritors of this class can be used as an ActiveX components. To avoid problems caused by exceptions in environments that can not handle them, exceptions can be caught and stored using ErrorHandler. This feature is ususally applied in methods with names like <method name>_...NE (where NE means "no exception").

It is also applicable in multithreading environments. Using this class as ancestor, exceptions caught in another thread can be retrieved by overloading getException.

Author:
Ferenc Csizmadia
See Also:
Serialized Form

Field Summary
static int CLASS_NOT_FOUND_ERROR
           
static int DATABASE_SEARCH_ERROR
           
protected  java.lang.Throwable exception
           
static int ILLEGAL_ACCESS_ERROR
           
static int INSTANTIATION_ERROR
           
static int IO_ERROR
           
static int MAX_SEARCH_FREQUENCY_EXCEEDED_ERROR
           
static int MOL_FORMAT_ERROR
           
static int NO_ERROR
           
static int PROPERTY_NOT_SET_ERROR
           
static int SQL_ERROR
           
static int UNIDENTIFIED_ERROR
           
 
Constructor Summary
ErrorHandler()
           
 
Method Summary
 void checkError()
          Throws the exception stored in the object.
 void checkException()
          Throws the exception stored in the object.
 int getError()
          Getter for property error.
 java.lang.String getErrorMessage()
          Getter for property errorMessage.
 java.lang.Throwable getException()
          Getter for property exception.
 java.lang.String getStackTrace()
          Getter for property stackTrace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_ERROR

public static final int NO_ERROR
See Also:
Constant Field Values

UNIDENTIFIED_ERROR

public static final int UNIDENTIFIED_ERROR
See Also:
Constant Field Values

MAX_SEARCH_FREQUENCY_EXCEEDED_ERROR

public static final int MAX_SEARCH_FREQUENCY_EXCEEDED_ERROR
See Also:
Constant Field Values

DATABASE_SEARCH_ERROR

public static final int DATABASE_SEARCH_ERROR
See Also:
Constant Field Values

MOL_FORMAT_ERROR

public static final int MOL_FORMAT_ERROR
See Also:
Constant Field Values

IO_ERROR

public static final int IO_ERROR
See Also:
Constant Field Values

PROPERTY_NOT_SET_ERROR

public static final int PROPERTY_NOT_SET_ERROR
See Also:
Constant Field Values

CLASS_NOT_FOUND_ERROR

public static final int CLASS_NOT_FOUND_ERROR
See Also:
Constant Field Values

INSTANTIATION_ERROR

public static final int INSTANTIATION_ERROR
See Also:
Constant Field Values

ILLEGAL_ACCESS_ERROR

public static final int ILLEGAL_ACCESS_ERROR
See Also:
Constant Field Values

SQL_ERROR

public static final int SQL_ERROR
See Also:
Constant Field Values

exception

protected java.lang.Throwable exception
Constructor Detail

ErrorHandler

public ErrorHandler()
Method Detail

getException

public java.lang.Throwable getException()
Getter for property exception.

Returns:
Value of property exception that is stored by the class.

getError

public int getError()
Getter for property error.

Returns:
Value of property error.

getErrorMessage

public java.lang.String getErrorMessage()
Getter for property errorMessage.

Returns:
Value of property errorMessage.

getStackTrace

public java.lang.String getStackTrace()
Getter for property stackTrace.

Returns:
Value of property stackTrace.

checkError

public void checkError()
                throws java.lang.Throwable
Throws the exception stored in the object.

Throws:
java.lang.Throwable

checkException

public void checkException()
                    throws java.lang.Exception
Throws the exception stored in the object. Needed because Tomcat errorpages don't handle errors of type Throwable that are not inheritors of Exception.

Throws:
java.lang.Exception