public class OCamlException extends java.lang.RuntimeException
OCamlException
class is the parent class of all wrapped
OCaml exceptions, also acting as a fallback cases for when the wrapped
exception cannot be precisely mapped.Modifier and Type | Field and Description |
---|---|
static java.lang.Object |
SLOT
Identifier for
OCamlException . |
Constructor and Description |
---|
OCamlException(org.ocamljava.runtime.kernel.FailException fe)
Constructs a new instance from an exception.
|
OCamlException(org.ocamljava.runtime.values.Value v)
Constructs a new instance from a value.
|
Modifier and Type | Method and Description |
---|---|
org.ocamljava.runtime.kernel.FailException |
getFailException()
Returns the underlying exception.
|
java.lang.String |
getOCamlName()
Returns the name (that acts as an identifier) of the underlying exception.
|
java.lang.String |
getOCamlStringRepresentation()
Returns the string representation of the underlying exception.
|
static void |
register(java.lang.String id,
java.lang.Class<?> cl)
Registers an exception in the context.
|
java.lang.String |
toString() |
static OCamlException |
wrap(org.ocamljava.runtime.kernel.FailException fe)
Wraps a
FailException exception into a OCamlException one,
using the map of registered exceptions. |
public static final java.lang.Object SLOT
OCamlException
.public OCamlException(org.ocamljava.runtime.kernel.FailException fe)
fe
- exception to build instance from - should not be null
public OCamlException(org.ocamljava.runtime.values.Value v)
OCamlException(new FailException(v))
v
- value to build instance from - should not be null
public final org.ocamljava.runtime.kernel.FailException getFailException()
public final java.lang.String getOCamlName()
public final java.lang.String getOCamlStringRepresentation()
public final java.lang.String toString()
toString
in class java.lang.Throwable
public static OCamlException wrap(org.ocamljava.runtime.kernel.FailException fe)
FailException
exception into a OCamlException
one,
using the map of registered exceptions.fe
- exception to wrap - should not be null
OCamlException
instance wrapping the passed exceptionpublic static void register(java.lang.String id, java.lang.Class<?> cl)
(FailException)
.id
- exception identifier - should not be null
cl
- class of exception to register - should not be null