All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class fr.inria.openmath.omapi.OMException

java.lang.Object
   |
   +----java.lang.Throwable
           |
           +----java.lang.Exception
                   |
                   +----java.lang.RuntimeException
                           |
                           +----fr.inria.openmath.omapi.OMException

public class OMException
extends RuntimeException
Encapsulates a general OpenMath error.

This class contains basic error information from all OpenMath methods.

Note that this is a runtime exception and thus you are not forced to explicitly handle propagation of such exceptions (as main effect the try/catch is facultative).


Variable Index

 o OME_END_OBJECT
Mark the end of object during parsing
 o OME_GENERIC
This is the vanilla exception
 o OME_HIERARCHY_REQUEST
A request has been made that breaks the hierarchy rules of OpenMath trees eg: looking for children of a node that can't have children.
 o OME_INT_OVERFLOW
A conversion to int was unsuccessful due to an overflow
 o OME_INTERNAL
Something unsupected went wrong
 o OME_NODE_NOT_FOUND
A node that was required has not been found
 o OME_SYNTAX
A syntax error occured during a parsing process
 o OME_UNKNOWN
This is not a legal exception error code
 o OME_UNLEGAL_BASE
When requested base is not legal.
 o OME_WRAPPING
This exception is a wrapper (it holds another one)

Constructor Index

 o OMException(Exception)
Creates a new OMException wrapping an existing exception.
 o OMException(String)
Creates a new OMException.
 o OMException(String, Exception)
Creates a new OMException from an existing exception.
 o OMException(String, short)
Creates a new OMException with a message and an specific error code.

Method Index

 o getErrorCode()
Returns the specific error code of this exception.
 o getException()
Returns the embedded exception, if any.
 o getMessage()
Returns a detail message for this exception.
 o toString()
Converts this exception to a string.

Variables

 o OME_UNKNOWN
 public static final short OME_UNKNOWN
This is not a legal exception error code

 o OME_INTERNAL
 public static final short OME_INTERNAL
Something unsupected went wrong

 o OME_WRAPPING
 public static final short OME_WRAPPING
This exception is a wrapper (it holds another one)

 o OME_GENERIC
 public static final short OME_GENERIC
This is the vanilla exception

 o OME_NODE_NOT_FOUND
 public static final short OME_NODE_NOT_FOUND
A node that was required has not been found

 o OME_SYNTAX
 public static final short OME_SYNTAX
A syntax error occured during a parsing process

 o OME_INT_OVERFLOW
 public static final short OME_INT_OVERFLOW
A conversion to int was unsuccessful due to an overflow

 o OME_HIERARCHY_REQUEST
 public static final short OME_HIERARCHY_REQUEST
A request has been made that breaks the hierarchy rules of OpenMath trees eg: looking for children of a node that can't have children.

 o OME_UNLEGAL_BASE
 public static final short OME_UNLEGAL_BASE
When requested base is not legal.

eg: in the Float.setPreferedBase()

 o OME_END_OBJECT
 public static final short OME_END_OBJECT
Mark the end of object during parsing

Constructors

 o OMException
 public OMException(String message)
Creates a new OMException.

Parameters:
message - The error message.
 o OMException
 public OMException(Exception e)
Creates a new OMException wrapping an existing exception.

The existing exception will be embedded in the new one, and its message will become the default message for the OMException.

Parameters:
e - The exception to be wrapped in a OMException.
 o OMException
 public OMException(String message,
                    Exception e)
Creates a new OMException from an existing exception.

The existing exception will be embedded in the new one, but the new exception will have its own message.

Parameters:
message - The detail message.
e - The exception to be wrapped in a OMException.
 o OMException
 public OMException(String message,
                    short errorCode)
Creates a new OMException with a message and an specific error code.

Parameters:
message - The detail message.
errorCode - The specific error code.

Methods

 o getMessage
 public String getMessage()
Returns a detail message for this exception.

If there is a embedded exception, and if the OMException has no detail message of its own, this method will return the detail message from the embedded exception.

Returns:
The error message.
Overrides:
getMessage in class Throwable
 o getException
 public Exception getException()
Returns the embedded exception, if any.

Returns:
The embedded exception, or null if there is none.
 o getErrorCode
 public short getErrorCode()
Returns the specific error code of this exception.

Returns:
The specific error code of this exception.
 o toString
 public String toString()
Converts this exception to a string.

Returns:
A string version of this exception.
Overrides:
toString in class Throwable

All Packages  Class Hierarchy  This Package  Previous  Next  Index