errorcode-rpc.md 5.4 KB
Newer Older
A
Annie_wang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251
# RPC Error Codes

The APIs of the **rpc** module return exceptions since API version 9.

## 1900001 Failed to Call mmap

**Error Message**

Call mmap function failed.

**Description**

The mmap function failed.

**Possible Causes**

1. The mapping area is too large.
2. There is no sufficient memory for mapping.

**Solution**

1. Check whether the memory specified in **Ashmem::create()** is too large.
2. Check whether the system has sufficient memory for the mapping operation.

## 1900002 Failed to Call ioctl

**Error Message**

Call os ioctl function failed.

**Description**

Failed to call **ioctl** with the shared memory file descriptor.

**Possible Causes**

1. Invalid kernel parameters are set.
2. The specified type does not comply with the types specified when the shared memory is mapped.

**Solution**

1. Check whether the specified parameters are **PROT_EXEC**, **PROT_READ**, and **PROT_WRITE** of the **Ashmem** class.
2. Check whether the type specified is one of the types specified when the shared memory is mapped.

## 1900003 Failed to Write Data to the Shared Memory

**Error Message**

Write to ashmem failed.

**Description**

Failed to write data to the shared memory.

**Possible Causes**

1. The size of a single write or total size of continuous writes exceeds the size of the shared memory.
2. The PROT_WRITE mode is not enabled for the shared memory.

**Solution**

1. Check whether the data to be written to the shared memory exceeds the total size of the shared memory mapped.
2. Check that PROT_WRITE is enabled for the shared memory.

## 1900004 Failed to Read Data from the Shared Memory

**Error Message**

Read from ashmem failed.

**Description**

Failed to read data from the shared memory.

**Possible Causes**

1. The size of a single read or total size of continuous reads exceeds the size of the shared memory.
2. The PROT_READ mode is not enabled for the shared memory.

**Solution**

1. Check whether the data to be read exceeds the total size of the shared memory mapped.
2. Check that PROT_READ is enabled for the shared memory.

## 1900005 Operation Allowed Only for the Proxy Object

**Error Message**

Only proxy object permitted.

**Description**

This operation is allowed only on the proxy object.

**Possible Causes**

A method supported only by the **RemoteProxy** object is called for the **RemoteObject** object.

**Solution**

Check whether a method supported only by the **RemoteProxy** object is called for the **RemoteObject** object.

## 1900006 Operation Allowed Only for the Remote Object

**Error Message**

Only remote object permitted.

**Description**

This operation is allowed only on the remote object.

**Possible Causes**

A method supported only by the **RemoteObject** object is called for the **RemoteProxy** object.

**Solution**

Check whether a method supported only by the **RemoteObject** object is called for the **RemoteProxy** object.

## 1900007 Failed to Communicate with the Remote Object

**Error Message**

Communication failed.

**Description**

Failed to communicate with the remote object over IPC.

**Possible Causes**

1. The remote object has been destroyed.
2. The remote object is re-created, but the proxy object held by the local end has expired.

**Solution**

1. Check whether the remote object has been destroyed.
2. Check whether an observer for listening for the dead status of the remote object is registered, and whether the remote object is destructed and created again.

## 1900008 Invalid IPC Object

**Error Message**

Proxy or remote object is invalid.

**Description**

The proxy or remote object is invalid.

**Possible Causes**

1. The proxy object is invalid.
2. The remote object has been destroyed.

**Solution**

1. Check whether an exception occurs when the proxy object is obtained.
2. Check whether the remote object is destructed.

## 1900009 Failed to Write Data to MessageSequence

**Error Message**

Write data to message sequence failed.

**Description**

Failed to write data to **MessageSequence**.

**Possible Causes**

The default **MessageSequence** space is full.

**Solution**

Use the method provided by **MessageSequence** to check whether **MessageSequence** has sufficient space.

## 1900010 Failed to Read Data from MessageSequence

**Error Message**

Read data from message sequence failed.

**Description**

Failed to read data from **MessageSequence**.

**Possible Causes**

The data read sequence is different from the data write sequence.

**Solution**

Check that the data read sequence is the same as the data write sequence.

## 1900011 Memory Allocation Failed

**Error Message**

Sequence memory alloc failed.

**Description**

Failed to allocate memory during serialization.

**Possible Causes**

The data to write is too large.

**Solution**

Check whether the data to write is too large or whether parameters are set improperly.

## 1900012 JS Callback Failed

**Error Message**

Call JS callback function failed.

**Description**

Failed to invoke the JS callback.

**Possible Causes**

The JS function of the service returns a failure message.

**Solution**

Check whether the JS function is successfully executed.

## 1900013 Failed to Invoke dup

**Error Message**

Call os dup function failed.

**Description**

Failed to call dup.

**Possible Causes**

1. The file handle resources of the process are used up.
2. The specified **fd** is closed.

**Solution**

1. Check whether the input parameter** fd** is valid.
2. Check whether there are file handle resources of the process.