Package ai.onnxruntime
Class OrtException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- ai.onnxruntime.OrtException
-
- All Implemented Interfaces:
java.io.Serializable
public class OrtException extends java.lang.Exception
An exception which contains the error message and code produced by the native onnxruntime.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OrtException.OrtErrorCode
Maps theOrtErrorCode
struct inonnxruntime_c_api.h
with an additional entry for Java side errors.
-
Constructor Summary
Constructors Constructor Description OrtException(int code, java.lang.String message)
Used to throw an exception from native code as it handles the enum lookup in Java.OrtException(OrtException.OrtErrorCode code, java.lang.String message)
Creates an OrtException using the specified error code and message.OrtException(java.lang.String message)
Creates an OrtException with a default Java error code and the specified message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OrtException.OrtErrorCode
getCode()
Return the error code.
-
-
-
Constructor Detail
-
OrtException
public OrtException(java.lang.String message)
Creates an OrtException with a default Java error code and the specified message.- Parameters:
message
- The message to use.
-
OrtException
public OrtException(int code, java.lang.String message)
Used to throw an exception from native code as it handles the enum lookup in Java.- Parameters:
code
- The error code.message
- The message.
-
OrtException
public OrtException(OrtException.OrtErrorCode code, java.lang.String message)
Creates an OrtException using the specified error code and message.- Parameters:
code
- The error code from the native runtime.message
- The error message.
-
-
Method Detail
-
getCode
public OrtException.OrtErrorCode getCode()
Return the error code.- Returns:
- The error code.
-
-