Package ai.onnxruntime
Class OrtException
java.lang.Object
java.lang.Throwable
java.lang.Exception
ai.onnxruntime.OrtException
- All Implemented Interfaces:
Serializable
An exception which contains the error message and code produced by the native onnxruntime.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumMaps theOrtErrorCodestruct inonnxruntime_c_api.hwith an additional entry for Java side errors. -
Constructor Summary
ConstructorsConstructorDescriptionOrtException(int code, String message) Used to throw an exception from native code as it handles the enum lookup in Java.OrtException(OrtException.OrtErrorCode code, String message) Creates an OrtException using the specified error code and message.OrtException(String message) Creates an OrtException with a default Java error code and the specified message. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
OrtException
Creates an OrtException with a default Java error code and the specified message.- Parameters:
message- The message to use.
-
OrtException
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
Creates an OrtException using the specified error code and message.- Parameters:
code- The error code from the native runtime.message- The error message.
-
-
Method Details
-
getCode
Return the error code.- Returns:
- The error code.
-