mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-30 01:38:53 +00:00
Add new ZT_ result codes that were added
This commit is contained in:
parent
f8ba1962e6
commit
844725237d
@ -44,6 +44,7 @@ jobject createResultObject(JNIEnv *env, ZT_ResultCode code)
|
||||
switch(code)
|
||||
{
|
||||
case ZT_RESULT_OK:
|
||||
case ZT_RESULT_OK_IGNORED:
|
||||
LOGV("ZT_RESULT_OK");
|
||||
fieldName = "RESULT_OK";
|
||||
break;
|
||||
@ -56,12 +57,20 @@ jobject createResultObject(JNIEnv *env, ZT_ResultCode code)
|
||||
fieldName = "RESULT_FATAL_ERROR_DATA_STORE_FAILED";
|
||||
break;
|
||||
case ZT_RESULT_ERROR_NETWORK_NOT_FOUND:
|
||||
LOGV("RESULT_FATAL_ERROR_DATA_STORE_FAILED");
|
||||
LOGV("ZT_RESULT_ERROR_NETWORK_NOT_FOUND");
|
||||
fieldName = "RESULT_ERROR_NETWORK_NOT_FOUND";
|
||||
break;
|
||||
case ZT_RESULT_ERROR_UNSUPPORTED_OPERATION:
|
||||
LOGV("ZT_RESULT_ERROR_UNSUPPORTED_OPERATION");
|
||||
fieldName = "RESULT_ERROR_UNSUPPORTED_OPERATION";
|
||||
break;
|
||||
case ZT_RESULT_ERROR_BAD_PARAMETER:
|
||||
LOGV("ZT_RESULT_ERROR_BAD_PARAMETER");
|
||||
fieldName = "ZT_RESULT_ERROR_BAD_PARAMETER";
|
||||
break;
|
||||
case ZT_RESULT_FATAL_ERROR_INTERNAL:
|
||||
default:
|
||||
LOGV("RESULT_FATAL_ERROR_DATA_STORE_FAILED");
|
||||
LOGV("ZT_RESULT_FATAL_ERROR_INTERNAL");
|
||||
fieldName = "RESULT_FATAL_ERROR_INTERNAL";
|
||||
break;
|
||||
}
|
||||
|
@ -45,30 +45,35 @@ public enum ResultCode {
|
||||
/**
|
||||
* Ran out of memory
|
||||
*/
|
||||
RESULT_FATAL_ERROR_OUT_OF_MEMORY(1),
|
||||
RESULT_FATAL_ERROR_OUT_OF_MEMORY(100),
|
||||
|
||||
/**
|
||||
* Data store is not writable or has failed
|
||||
*/
|
||||
RESULT_FATAL_ERROR_DATA_STORE_FAILED(2),
|
||||
RESULT_FATAL_ERROR_DATA_STORE_FAILED(101),
|
||||
|
||||
/**
|
||||
* Internal error (e.g. unexpected exception indicating bug or build problem)
|
||||
*/
|
||||
RESULT_FATAL_ERROR_INTERNAL(3),
|
||||
RESULT_FATAL_ERROR_INTERNAL(102),
|
||||
|
||||
// non-fatal errors
|
||||
|
||||
/**
|
||||
* Network ID not valid
|
||||
*/
|
||||
RESULT_ERROR_NETWORK_NOT_FOUND(1000);
|
||||
RESULT_ERROR_NETWORK_NOT_FOUND(1000),
|
||||
|
||||
RESULT_ERROR_UNSUPPORTED_OPERATION(1001),
|
||||
|
||||
RESULT_ERROR_BAD_PARAMETER(1002);
|
||||
|
||||
|
||||
private final int id;
|
||||
ResultCode(int id) { this.id = id; }
|
||||
public int getValue() { return id; }
|
||||
|
||||
public boolean isFatal(int id) {
|
||||
return (id > 0 && id < 1000);
|
||||
return (id > 100 && id < 1000);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user