Provides IPC error code definitions for identifying and handling various errors that may occur during IPC communication. Based on the returned error codes, you can quickly locate the cause of issues, such as parameter errors, serialization failures, memory allocation failures, and remote object death, and take appropriate error handling measures.
File to include: <IPCKit/ipc_error_code.h>
Library: libipc_capi.so
System capability: SystemCapability.Communication.IPC.Core
Supported device types This API is available for all device types. You can determine whether the function is available by checking the system capability SystemCapability.Communication.IPC.Core.
Since: 12
Related module: OHIPCErrorCode
| Name | typedef Keyword | Description |
|---|---|---|
| OH_IPC_ErrorCode | OH_IPC_ErrorCode | Enumerates the IPC error codes. |
enum OH_IPC_ErrorCode
Description
Enumerates the IPC error codes.
Since: 12
| Enum | Description |
|---|---|
| OH_IPC_SUCCESS = 0 | Operation success. |
| OH_IPC_ERROR_CODE_BASE = 1901000 | Start value of the error code range. |
| OH_IPC_CHECK_PARAM_ERROR = OH_IPC_ERROR_CODE_BASE | Parameter error. This error code is returned when the input parameter is a null pointer, the parameter value is out of the valid range, or the parameter type does not match. The developer should check the validity and legality of the parameters. |
| OH_IPC_PARCEL_WRITE_ERROR = OH_IPC_ERROR_CODE_BASE + 1 | Failed to write data to the serialized object. This error may occur when the memory is insufficient during data serialization or the data format is not supported. The developer should check whether the data size and format meet the requirements. |
| OH_IPC_PARCEL_READ_ERROR = OH_IPC_ERROR_CODE_BASE + 2 | Failed to read data from the serialized object. This error may occur when the length of the data to be read exceeds the actual data length or the data format does not match. The developer should check whether the data reading order and data format are correct. |
| OH_IPC_MEM_ALLOCATOR_ERROR = OH_IPC_ERROR_CODE_BASE + 3 | Memory allocation failure. This error code is returned when the system memory is insufficient or the memory allocator is abnormal. The developer should check the memory usage and retry after releasing unnecessary resources. |
| OH_IPC_CODE_OUT_OF_RANGE = OH_IPC_ERROR_CODE_BASE + 4 | The command word is out of the defined range [0x01, 0x00FFFFFF]. This error code is returned when the command word used in IPC communication is not within the valid range. The developer should check whether the command word definition meets the specification requirements. |
| OH_IPC_DEAD_REMOTE_OBJECT = OH_IPC_ERROR_CODE_BASE + 5 | Remote object death. This error code is returned when the peer process of the IPC communication has exited or the remote object has been destroyed. The developer should re-establish the connection or use an alternative service. |
| OH_IPC_INVALID_USER_ERROR_CODE = OH_IPC_ERROR_CODE_BASE + 6 | The user-defined error code is out of the range [1909000, 1909999]. This error code is returned when the custom error code set by the developer is not within the allowed range. The developer should ensure that the custom error code is within the valid range. |
| OH_IPC_INNER_ERROR = OH_IPC_ERROR_CODE_BASE + 7 | IPC internal error. This error code is returned when an unknown error occurs inside the IPC system. The developer can record logs and contact technical support or retry later. |
| OH_IPC_ERROR_CODE_MAX = OH_IPC_ERROR_CODE_BASE + 1000 | Maximum value of the error code range. |
| OH_IPC_USER_ERROR_CODE_MIN = 1909000 | Minimum value of the user-defined error code. |
| OH_IPC_USER_ERROR_CODE_MAX = 1909999 | Maximum value of the user-defined error code. |