Package ej.sni
Class NativeException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- ej.sni.NativeException
-
- All Implemented Interfaces:
Serializable
public class NativeException extends RuntimeException
RuntimeExceptionsubclass that may be thrown from an SNI native usingSNI_throwNativeException()function.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NativeException(int errorCode, String errorMessage)Constructs a newNativeExceptionwith the specified error code and detail message.NativeException(int errorCode, String errorMessage, Throwable cause)Constructs a newNativeExceptionwith the specified error code, detail message and cause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetErrorCode()Returns the error code of thisNativeException.StringgetMessage()Returns the detail message string of thisNativeException.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, toString
-
-
-
-
Constructor Detail
-
NativeException
public NativeException(int errorCode, String errorMessage)Constructs a newNativeExceptionwith the specified error code and detail message.- Parameters:
errorCode- the error code. The error code is saved for later retrieval by thegetErrorCode()method.errorMessage- the detail message. The detail message is saved for later retrieval by thegetMessage()method.
-
NativeException
public NativeException(int errorCode, String errorMessage, @Nullable Throwable cause)Constructs a newNativeExceptionwith the specified error code, detail message and cause.- Parameters:
errorCode- the error code. The error code is saved for later retrieval by thegetErrorCode()method.errorMessage- the detail message. The detail message is saved for later retrieval by thegetMessage()method.cause- the cause (which is saved for later retrieval by theThrowable.getCause()method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
-
-
Method Detail
-
getMessage
@Nullable public String getMessage()
Returns the detail message string of thisNativeException.- Overrides:
getMessagein classThrowable- Returns:
- the detail message string of this
NativeExceptioninstance (which may benull).
-
getErrorCode
public int getErrorCode()
Returns the error code of thisNativeException.- Returns:
- the error code of this
NativeExceptioninstance.
-
-