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).
-
OME_END_OBJECT
- Mark the end of object during parsing
-
OME_GENERIC
- This is the vanilla exception
-
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.
-
OME_INT_OVERFLOW
- A conversion to int was unsuccessful due to
an overflow
-
OME_INTERNAL
- Something unsupected went wrong
-
OME_NODE_NOT_FOUND
- A node that was required has not been found
-
OME_SYNTAX
- A syntax error occured during a parsing process
-
OME_UNKNOWN
- This is not a legal exception error code
-
OME_UNLEGAL_BASE
- When requested base is not legal.
-
OME_WRAPPING
- This exception is a wrapper (it holds another one)
-
OMException(Exception)
- Creates a new OMException wrapping an existing exception.
-
OMException(String)
- Creates a new OMException.
-
OMException(String, Exception)
- Creates a new OMException from an existing exception.
-
OMException(String, short)
- Creates a new OMException with a message and an specific error code.
-
getErrorCode()
- Returns the specific error code of this exception.
-
getException()
- Returns the embedded exception, if any.
-
getMessage()
- Returns a detail message for this exception.
-
toString()
- Converts this exception to a string.
OME_UNKNOWN
public static final short OME_UNKNOWN
- This is not a legal exception error code
OME_INTERNAL
public static final short OME_INTERNAL
- Something unsupected went wrong
OME_WRAPPING
public static final short OME_WRAPPING
- This exception is a wrapper (it holds another one)
OME_GENERIC
public static final short OME_GENERIC
- This is the vanilla exception
OME_NODE_NOT_FOUND
public static final short OME_NODE_NOT_FOUND
- A node that was required has not been found
OME_SYNTAX
public static final short OME_SYNTAX
- A syntax error occured during a parsing process
OME_INT_OVERFLOW
public static final short OME_INT_OVERFLOW
- A conversion to int was unsuccessful due to
an overflow
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.
OME_UNLEGAL_BASE
public static final short OME_UNLEGAL_BASE
- When requested base is not legal.
eg: in the Float.setPreferedBase()
OME_END_OBJECT
public static final short OME_END_OBJECT
- Mark the end of object during parsing
OMException
public OMException(String message)
- Creates a new OMException.
- Parameters:
- message - The error message.
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.
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.
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.
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
getException
public Exception getException()
- Returns the embedded exception, if any.
- Returns:
- The embedded exception, or null if there is none.
getErrorCode
public short getErrorCode()
- Returns the specific error code of this exception.
- Returns:
- The specific error code of this exception.
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