Package chemaxon.util
Class ErrorHandler
- java.lang.Object
-
- chemaxon.util.ErrorHandler
-
@PublicAPI public abstract class ErrorHandler extends Object
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
(whereNE
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
-
-
Field Summary
Fields Modifier and Type Field Description static int
CLASS_NOT_FOUND_ERROR
static int
DATABASE_SEARCH_ERROR
protected 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
SQL_ERROR
static int
UNIDENTIFIED_ERROR
-
Constructor Summary
Constructors Constructor Description ErrorHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkError()
Throws the exception stored in the object.void
checkException()
Throws the exception stored in the object.int
getError()
Getter for property error.String
getErrorMessage()
Getter for property errorMessage.Throwable
getException()
Getter for property exception.String
getStackTrace()
Getter for property stackTrace.
-
-
-
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
-
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 volatile Throwable exception
-
-
Method Detail
-
getException
public 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 String getErrorMessage()
Getter for property errorMessage.- Returns:
- Value of property errorMessage.
-
getStackTrace
public String getStackTrace()
Getter for property stackTrace.- Returns:
- Value of property stackTrace.
-
checkError
public void checkError() throws Throwable
Throws the exception stored in the object.- Throws:
Throwable
- the exception stored
-
-