Package org.zvec.binding
Class ZvecException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.zvec.binding.ZvecException
- All Implemented Interfaces:
Serializable
Zvec-specific exception. Wraps the error code and the message the native
layer recorded for the failure.
The message is read from the C API's thread-local error state
(zvec_get_last_error_details) when the exception is created from a
return code, so Throwable.getMessage() explains why the call was
rejected instead of only naming the error code.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionZvecException(int code) Build an exception forcode, carrying the native error message.ZvecException(int code, String message) ZvecException(ErrorCode errorCode) ZvecException(ErrorCode errorCode, String message) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanbooleanstatic voidthrowIfError(int code) Throw if code != ZVEC_OK (0).static voidthrowIfError(int code, String context) Throw if code != ZVEC_OK, with additional context message.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ZvecException
-
ZvecException
-
ZvecException
-
ZvecException
public ZvecException(int code) Build an exception forcode, carrying the native error message.
-
-
Method Details
-
getErrorCode
-
throwIfError
public static void throwIfError(int code) Throw if code != ZVEC_OK (0). -
throwIfError
Throw if code != ZVEC_OK, with additional context message. -
isNotFound
public boolean isNotFound() -
isAlreadyExists
public boolean isAlreadyExists() -
isInvalidArgument
public boolean isInvalidArgument()
-