Package chemaxon.util

Class ErrorHandler

java.lang.Object
chemaxon.util.ErrorHandler
Direct Known Subclasses:
ConnectionHandler, JChemSearch, chemaxon.sss.search.extended.util.MolHandlerBase, UpdateHandler

@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 (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.

  • Field Details

  • Constructor Details

    • ErrorHandler

      public ErrorHandler()
  • Method Details

    • 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
    • checkException

      public void checkException() throws 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:
      Exception - the exception stored, boxed as Exception