未验证 提交 e8c2d83e 编写于 作者: O openharmony_ci 提交者: Gitee

!12184 [翻译完成】#I5W1U7

Merge pull request !12184 from Annie_wang/PR10656A
# Access Token Error Codes # Ability Access Control Error Codes
## 401 Parameter Error ## 12100001 Invalid Parameters
### Error Message **Error Message**
Parameter error.${messageInfo}.
### Possible Causes Parameter invalid, message is ${messageInfo}.
This error code is reported if an error occurs during JS parameter parsing. The possible causes are as follows:
1. The number of input parameters is insufficient.
2. The parameter type is incorrect.
### Solution **Possible Causes**
1. Add input parameters.
2. Correct parameter types.
This error code is reported if an error occurs during parameter verification. The possible causes are as follows:
- The value of **tokenId** is **0**.
- The permission name is empty or exceeds 256 characters.
- The **flag** value in the permission authorization or revocation request is invalid.
- The input parameters specified for registering a listener are incorrect.
## 201 Permission denied. **Solution**
### Error Message Correct the invalid parameter values.
Permission denied.${messageInfo}.
### Possible Causes
This error code is reported if the application process that calls an API is not granted the required permission. The possible causes are as follows:
1. The application process is not granted the required permission.
2. The permission requires user authorization to take effect, but the application process does not obtain the user authorization.
### Solution ## 12100002 TokenId Does Not Exist
1. Check whether the application process is granted the required permission.
2. Check whether the application process has obtained the user authorization if the permission requires user authorization to take effect.
**Error Message**
## 12100001 Invalid Parameters TokenId does not exist.
### Error Message **Possible Causes**
Parameter invalid, message is ${messageInfo}.
### Possible Causes - The specified **tokenId** does not exist.
This error code is reported if an error occurs during parameter verification. The possible causes are as follows: - The process of the specified **tokenId** is not an application process.
1. The value of **tokenId** is **0**.
2. The specified permission name is empty or contains more than 256 characters.
3. The **flag** value in the permission authorization or revocation request is invalid.
4. The input parameters specified for registering a listener are incorrect.
### Solution **Solution**
1. Correct the invalid parameter values.
Set **tokenId** correctly.
## 12100002 TokenId does not exist.
### Error Message ## 12100003 Permission Does Not Exist
TokenId does not exist.
### Possible Causes
1. The specified **tokenId** does not exist.
2. The process corresponding to the specified **tokenId** is not an application process.
### Solution **Error Message**
Set a correct **tokenId**, and make sure that the process corresponding to the specified **tokenId** is an application process.
Permission does not exist.
## 12100003 Permission Not Exist **Possible Causes**
### Error Message - The specified **permissionName** does not exist.
Permission does not exist. - The specified **permissionName** does not match the **tokenId** in the permission authorization or revocation scenario.
- The specified **permissionName** is not a sensitive permission that requires user authorization.
### Possible Causes **Solution**
1. The specified **permissionName** does not exist.
2. The specified **permissionName** does not match the specified **tokenId** in the permission authorization or revocation scenario.
3. The specified **permissionName** is not a sensitive permission that requires user authorization.
### Solution
Set the **permissionName** parameter correctly. For details, see [permission-list](../../security/permission-list.md). Set the **permissionName** parameter correctly. For details, see [permission-list](../../security/permission-list.md).
## 12100004 Listener APIs Not Used in Pairs ## 12100004 Listener APIs Not Used in Pairs
### Error Message **Error Message**
The listener interface is not used together.
The interface is not used together.
**Possible Causes**
### Possible Causes
This error code is reported if listener APIs are not used in pairs. The possible causes are as follows: This error code is reported if listener APIs are not used in pairs. The possible causes are as follows:
1. The listener APIs that need to be used in pairs are repeatedly called. 1. The listener APIs that need to be used in pairs are repeatedly called.
2. The listener APIs that need to be used in pairs are independently called. 2. The listener APIs that need to be used in pairs are independently called.
### Solution **Solution**
1. Check whether the API needs to be used in pairs. That is, if an API is called to enable listening, an API with the same input parameters cannot be called unless an API is called to stop listening first. 1. Check whether the API needs to be used in pairs. That is, if an API is called to enable listening, an API with the same input parameters cannot be called unless an API is called to stop listening first.
2. Check whether the API needs to be used in pairs. That is, an API for disabling listening or unregistering a listener can only be called after the API for enabling listening or registering a listener is called. 2. Check whether the API needs to be used in pairs. That is, an API for disabling listening or unregistering a listener can only be called after the API for enabling listening or registering a listener is called.
## 12100005 Listener Overflow ## 12100005 Listener Overflow
### Error Message **Error Message**
The number of listeners exceeds the limit. The number of listeners exceeds the limit.
### Possible Causes **Possible Causes**
The number of listeners exceeds 200 (the upper limit). The number of listeners exceeds 200 (the upper limit).
### Solution **Solution**
Abandon unused listeners in a timely manner.
Release unused listeners in a timely manner.
## 12100006 Permission Granting or Revocation Not Supported for the Specified Application ## 12100006 Permission Granting or Revocation Not Supported for the Specified Application
### Error Message **Error Message**
The specified application does not support the permissions granted or ungranted as specified. The specified application does not support the permissions granted or ungranted as specified.
### Possible Causes **Possible Causes**
1. The specified **tokenId** is the identity of the remote device. Distributed granting and revocation are not yet supported.
1. The specified **tokenId** is the identity of the remote device. Distributed permission granting and revocation are not yet supported.
2. The specified **tokenId** belongs to a sandbox application, which is not allowed to apply for the specified permission. 2. The specified **tokenId** belongs to a sandbox application, which is not allowed to apply for the specified permission.
### Solution **Solution**
1. Check whether the method of obtaining **tokenId** is correct. 1. Check whether the method of obtaining **tokenId** is correct.
2. Check whether the sandbox application works in restrictive mode. Most permissions cannot be granted to a sandbox application in restrictive mode. 2. Check whether the sandbox application works in restrictive mode. Most permissions cannot be granted to a sandbox application in restrictive mode.
## 12100007 System Services Not Working Properly ## 12100007 System Services Not Working Properly
### Error Message **Error Message**
Service is abnormal. Service is abnormal.
### Possible Causes **Possible Causes**
This error code is reported if system services are not working properly. The possible causes are as follows: This error code is reported if system services are not working properly. The possible causes are as follows:
1. The permission management service cannot be started properly. - The permission management service cannot start properly.
2. An error occurs while reading or writing IPC data. - The read or write of IPC data fails.
**Solution**
### Solution
System services do not work properly. Try again later or restart the device. System services do not work properly. Try again later or restart the device.
## 12100008 Out of Memory ## 12100008 Out of Memory
### Error Message **Error Message**
Out of memory. Out of memory.
### Possible Causes **Possible Causes**
The system memory is insufficient. The system memory is insufficient.
### Solution **Solution**
Try again later or restart the device. Try again later or restart the device.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册