Class ZvecException

All Implemented Interfaces:
Serializable

public class ZvecException extends RuntimeException
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 Details

    • ZvecException

      public ZvecException(ErrorCode errorCode, String message)
    • ZvecException

      public ZvecException(ErrorCode errorCode)
    • ZvecException

      public ZvecException(int code, String message)
    • ZvecException

      public ZvecException(int code)
      Build an exception for code, carrying the native error message.
  • Method Details

    • getErrorCode

      public ErrorCode getErrorCode()
    • throwIfError

      public static void throwIfError(int code)
      Throw if code != ZVEC_OK (0).
    • throwIfError

      public static void throwIfError(int code, String context)
      Throw if code != ZVEC_OK, with additional context message.
    • isNotFound

      public boolean isNotFound()
    • isAlreadyExists

      public boolean isAlreadyExists()
    • isInvalidArgument

      public boolean isInvalidArgument()