fix: 201 and 401 error messages optimized in English

Signed-off-by: yanghang <kongwei13@h-partners.com>
This commit is contained in:
yanghang 2024-07-01 17:14:17 +08:00
parent f06521df33
commit 22ab630f75
4 changed files with 25 additions and 25 deletions

View File

@ -46,7 +46,7 @@ declare namespace batteryInfo {
* @param { string } sceneValue - Indicates the battery charging scene value.
* sceneValue parameter must be of type string.
* @returns { number } Return to set the charging configuration result.
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types;
* @throws { BusinessError } 4900101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.BatteryManager.Core
@ -61,7 +61,7 @@ declare namespace batteryInfo {
* @param { string } sceneName - Indicates the battery charging scene name.
* sceneName parameter must be of type string.
* @returns { string } Returns the battery charging configuration, returns "" otherwise.
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types;
* @throws { BusinessError } 4900101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.BatteryManager.Core
@ -76,7 +76,7 @@ declare namespace batteryInfo {
* @param { string } sceneName - Indicates the battery charging scene name.
* sceneName parameter must be of type string.
* @returns { boolean } Returns true if the device supports the charging scene, returns false otherwise.
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types;
* @throws { BusinessError } 4900101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.BatteryManager.Core

View File

@ -115,7 +115,7 @@ declare namespace batteryStats {
* Obtains the power consumption information list.
*
* @returns { Promise<Array<BatteryStatsInfo>> } Power consumption information list.
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 4600101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.BatteryStatistics
* @systemapi
@ -128,7 +128,7 @@ declare namespace batteryStats {
*
* @param { AsyncCallback<Array<BatteryStatsInfo>> } callback Indicates the callback of power consumption information list.
* AsyncCallback encapsulates an interface of BatteryStatsInfo type.
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Parameter verification failed.
* @throws { BusinessError } 4600101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.BatteryStatistics
@ -142,7 +142,7 @@ declare namespace batteryStats {
*
* @param { number } uid Indicates the uid.
* @returns { number } Power consumption information(mAh).
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 4600101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.BatteryStatistics
* @systemapi
@ -155,7 +155,7 @@ declare namespace batteryStats {
*
* @param { number } uid Indicates the uid.
* @returns { number } Power consumption information(Percent).
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 4600101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.BatteryStatistics
* @systemapi
@ -169,7 +169,7 @@ declare namespace batteryStats {
* @param { ConsumptionType } type Indicates the hardware type.
* the ConsumptionType type is an enumeration class.
* @returns { number } Power consumption information(mAh).
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Parameter verification failed.
* @throws { BusinessError } 4600101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.BatteryStatistics
@ -184,7 +184,7 @@ declare namespace batteryStats {
* @param { ConsumptionType } type Indicates the hardware type.
* the ConsumptionType type is an enumeration class.
* @returns { number } Power consumption information(Percent).
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Parameter verification failed.
* @throws { BusinessError } 4600101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.BatteryStatistics

View File

@ -34,7 +34,7 @@ declare namespace brightness {
*
* @param { number } value Brightness value, ranging from 0 to 255.
* value parameter must be of type number.
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified;
* 2. Incorrect parameter types;
* @throws { BusinessError } 4700101 - Failed to connect to the service.
@ -53,7 +53,7 @@ declare namespace brightness {
* You are advised to set this parameter to true during the continuous adjustment and
* to false at the end of the continuous adjustment for better performance.
* continuous parameter must be of type boolean.
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified;
* 2. Incorrect parameter types;
* @throws { BusinessError } 4700101 - Failed to connect to the service.

28
api/@ohos.power.d.ts vendored
View File

@ -35,8 +35,8 @@ declare namespace power {
* @permission ohos.permission.REBOOT
* @param { string } reason Indicates the shutdown reason.
* reason parameter must be of type string.
* @throws { BusinessError } 201 - If the permission is denied.
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types;
* @throws { BusinessError } 4900101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.PowerManager.Core
@ -67,8 +67,8 @@ declare namespace power {
* @param { string } reason Indicates the restart reason. For example, "updater" indicates entering the updater mode
* after the restart. If the parameter is not specified, the system enters the normal mode after the restart.
* reason parameter must be of type string.
* @throws { BusinessError } 201 - If the permission is denied.
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types;
* @throws { BusinessError } 4900101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.PowerManager.Core
@ -116,7 +116,7 @@ declare namespace power {
*
* @param { string } detail Indicates the detail information who request wakeup.
* detail parameter must be of type string.
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types;
* @throws { BusinessError } 4900101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.PowerManager.Core
@ -128,7 +128,7 @@ declare namespace power {
/**
* Suspends the device to turn off the screen.
*
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 4900101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.PowerManager.Core
* @systemapi
@ -138,7 +138,7 @@ declare namespace power {
* Suspends the device to turn off the screen.
*
* @param { boolean } isImmediate Indicates whether suspend the device immediately.
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 4900101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.PowerManager.Core
* @systemapi
@ -163,8 +163,8 @@ declare namespace power {
* @param { DevicePowerMode } mode Indicates power mode {@link DevicePowerMode} to set.
* the DevicePowerMode type is an enumeration class.
* @param { AsyncCallback<void> } callback Indicates the callback of setting the power mode.
* @throws { BusinessError } 201 If the permission is denied.
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 201 Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Parameter verification failed.
* @throws { BusinessError } 4900101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.PowerManager.Core
@ -180,8 +180,8 @@ declare namespace power {
* @param { DevicePowerMode } mode Indicates power mode {@link DevicePowerMode} to set.
* the DevicePowerMode type is an enumeration class.
* @returns { Promise<void> }
* @throws { BusinessError } 201 If the permission is denied.
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 201 Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Parameter verification failed.
* @throws { BusinessError } 4900101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.PowerManager.Core
@ -204,7 +204,7 @@ declare namespace power {
* hibernate the device.
*
* @param { boolean } clearMemory - Indicates whether to clear the memory before the device hibernates.
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 4900101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.PowerManager.Core
* @systemapi
@ -216,8 +216,8 @@ declare namespace power {
* Sets the timeout duration(ms) for turning off the screen.
*
* @param { number } timeout - Indicates duration(ms) for turning off the screen. The value -1 means restore the default value.
* @throws { BusinessError } 201 If the permission is denied.
* @throws { BusinessError } 202 - If the system permission is denied.
* @throws { BusinessError } 201 Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 4900101 - Failed to connect to the service.
* @syscap SystemCapability.PowerManager.PowerManager.Core
* @systemapi