目录

class info
com.huawei.hms.mlsdk.common.MLException
Represents an exception processing class with various result codes of HUAWEI ML Kit encapsulated.

Constant Summary


TypeNameDesc
intUNKNOWN–1: Unknown error.
intSUCCESS0: Service running properly.
intDISCARDED1: Operation canceled.
intINNER2: Internal error.
intINACTIVE3: Service unavailable.
intNOT_SUPPORTED4: Operation not supported.
intILLEGAL_PARAMETER5: Incorrect parameter. This exception is irrelevant to services.
intOVERDUE6: Operation timed out.
intNO_FOUND7: Requested resource not found or not exist.
intDUPLICATE_FOUND8: Resource created repeatedly.
intNO_PERMISSION9: No operation permission.
intINSUFFICIENT_RESOURCE10: Resources exhausted.
The system resources or resources of the current user may be insufficient.
intANALYSIS_FAILURE11: Operation failed because the system was not ready.
intINTERRUPTED12: Operation interrupted, possibly due to concurrent operations.
intEXCEED_RANGE13: Out-of-bounds access.
intDATA_MISSING14: Unrecoverable data damage or loss.
intAUTHENTICATION_REQUIRED15: Identity authentication required.
intTFLITE_NOT_COMPATIBLE16: Downloaded model incompatible with the running model.
intINSUFFICIENT_SPACE17: Insufficient disk space.
intHASH_MISS18: Unexpected hash value of the downloaded model.

Public Constructor Summary

Constructor name
MLException(String message, int code)
Obtains an instance of MLException based on the exception information and result code.
MLException(String message, int code, Throwable innerException)
Obtains an instance of MLException based on the exception information, result code, and captured upper-layer exception information.

Public Method Summary

Return typeMethod name
intgetCode()

Constants

Constant
public static final int UNKNOWN
Unknown error.
Constant value: –1
Constant
public static final int SUCCESS
Service running properly.
Constant value: 0
Constant
public static final int DISCARDED
Operation canceled.
Constant value: 1
Constant
public static final int INNER
Internal error.
Constant value: 2
Constant
public static final int INACTIVE
Service unavailable.
Constant value: 3
Constant
public static final int NOT_SUPPORTED
Operation not supported.
Constant value: 4
Constant
public static final int ILLEGAL_PARAMETER
Incorrect parameter. This exception is irrelevant to services.
Constant value: 5
Constant
public static final int OVERDUE
Operation timed out.
Constant value: 6
Constant
public static final int NO_FOUND
Requested resource not found or not exist.
Constant value: 7
Constant
public static final int DUPLICATE_FOUND
Resource created repeatedly.
Constant value: 8
Constant
public static final int NO_PERMISSION
No operation permission.
Constant value: 9
Constant
public static final int INSUFFICIENT_RESOURCE
Resources exhausted. The system resources or resources of the current user may be insufficient.
Constant value: 10
Constant
public static final int ANALYSIS_FAILURE
Operation failed because the system was not ready.
Constant value: 11
Constant
public static final int INTERRUPTED
Operation interrupted, possibly due to concurrent operations.
Constant value: 12
Constant
public static final int EXCEED_RANGE
Out-of-bounds access.
Constant value: 13
Constant
public static final int DATA_MISSING
Unrecoverable data damage or loss.
Constant value: 14
Constant
public static final int AUTHENTICATION_REQUIRED
Identity authentication required.
Constant value: 15
Constant
public static final int TFLITE_NOT_COMPATIBLE
Downloaded model incompatible with the running model.
Constant value: 16
Constant
public static final int INSUFFICIENT_SPACE
Insufficient disk space.
Constant value: 17
Constant
public static final int HASH_MISS
Unexpected hash value of the downloaded model.
Constant value: 18

Public Constructors

Method
public MLException(String message, int code)
Obtains an instance of MLException based on the exception information and result code.

Parameters

Parameter nameParameter desc
messageException information
codeResult code
Method
public MLException(String message, int code, Throwable innerException)
Obtains an instance of MLException based on the exception information, result code, and captured upper-layer exception information.

Parameters

Parameter nameParameter desc
messageException information
codeResult code
innerExceptionUpper-layer exception information that is captured.

Public Methods

Method
public int getCode()
Obtains a result code.

Return

Typedesc
intResult code