| class info |
| com.huawei.hms.mlsdk.common.MLException |
| Represents an exception processing class with various result codes of HUAWEI ML Kit encapsulated. |
| Type | Name | Desc |
| int | UNKNOWN | –1: Unknown error. |
| int | SUCCESS | 0: Service running properly. |
| int | DISCARDED | 1: Operation canceled. |
| int | INNER | 2: Internal error. |
| int | INACTIVE | 3: Service unavailable. |
| int | NOT_SUPPORTED | 4: Operation not supported. |
| int | ILLEGAL_PARAMETER | 5: Incorrect parameter. This exception is irrelevant to services. |
| int | OVERDUE | 6: Operation timed out. |
| int | NO_FOUND | 7: Requested resource not found or not exist. |
| int | DUPLICATE_FOUND | 8: Resource created repeatedly. |
| int | NO_PERMISSION | 9: No operation permission. |
| int | INSUFFICIENT_RESOURCE | 10: Resources exhausted. The system resources or resources of the current user may be insufficient. |
| int | ANALYSIS_FAILURE | 11: Operation failed because the system was not ready. |
| int | INTERRUPTED | 12: Operation interrupted, possibly due to concurrent operations. |
| int | EXCEED_RANGE | 13: Out-of-bounds access. |
| int | DATA_MISSING | 14: Unrecoverable data damage or loss. |
| int | AUTHENTICATION_REQUIRED | 15: Identity authentication required. |
| int | TFLITE_NOT_COMPATIBLE | 16: Downloaded model incompatible with the running model. |
| int | INSUFFICIENT_SPACE | 17: Insufficient disk space. |
| int | HASH_MISS | 18: Unexpected hash value of the downloaded model. |
| 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. |
| Return type | Method name |
| int | getCode() |
| 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 |
| Method |
| public MLException(String message, int code) |
| Obtains an instance of MLException based on the exception information and result code. |
Parameters
| Parameter name | Parameter desc |
| message | Exception information |
| code | Result code |
Parameters
| Parameter name | Parameter desc |
| message | Exception information |
| code | Result code |
| innerException | Upper-layer exception information that is captured. |
| Method |
| public int getCode() |
| Obtains a result code. |
Return
| Type | desc |
| int | Result code |