We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
ReferencesApplication ServicesScreen Time Guard KitArkTS APIArkTS API Error Codes

ArkTS API Error Codes

NOTE

This section describes only module-specific error codes. For details about universal error codes, please refer to Universal Error Codes.

1019000001 Internal Error

Message

Internal error.

Description

Internal error.

Possible causes

  1. The current app is running in a private space or another subspace.

  2. A system service error or another internal error occurred.

Solution

  1. Switch to the main space and try again.

  2. Restart your device and try again.

  3. If the error persists, submit a ticket online. Huawei will get back to you as soon as possible.

1019000002 User Authorization Not Granted

Message

The user has not authorized the application to access this interface.

Description

The user has not authorized the app to access this API.

Possible causes

  1. The app has not requested authorization from the user.

  2. The user has denied the authorization request.

Solution

Call the requestUserAuth API to request user authorization.

1019000003 Operation Canceled by User

Message

The user canceled the operation.

Description

The user canceled the operation.

Possible causes

The user closed the semi-modal page.

Solution

No special handling is required because the user canceled the operation.

1019000004 Strategy Count Exceeds Maximum

Message

The number of strategies exceeds the upper limit.

Description

The number of strategies exceeds the maximum.

Possible causes

The number of strategies added to the same app exceeds the limit of 50.

Solution

Call the removeGuardStrategy API to delete some strategies to reduce the total number of strategies.

1019000005 Duplicate Strategy Name

Message

The strategy name is already existed.

Description

The strategy name already exists.

Possible causes

The user attempted to add a strategy with a duplicate name under the same app.

Solution

  1. Call the queryGuardStrategies API to obtain strategies under the app.

  2. Change the strategy name used in this API call to a unique one.

1019000006 Strategy Does Not Exist

Message

Nonexistent strategy.

Description

The strategy with the specified name does not exist.

Possible causes

  1. The strategy to be modified, deleted, started, or stopped does not exist.

  2. The queryGuardStrategyData API is called to query the data of a strategy that does not exist.

Solution

  1. Call the queryGuardStrategies API to obtain strategies under the app and check whether the corresponding strategy exists.

  2. Call the addGuardStrategy API to add the corresponding strategy and then perform the operation again.

1019000007 Duplicate Strategy Execution

Message

The strategy is already being executed.

Description

The strategy is already in execution.

Possible causes

The guard strategy to be started is already in execution.

Solution

Call the stopGuardStrategy API to stop the strategy and then perform the operation again.

1019000008 Strategy Not Executed

Message

This strategy has not been started yet.

Description

The strategy has not been started yet.

Possible causes

  1. The guard strategy to be stopped is not in execution.

  2. The execution data of a guard strategy that is not in execution is queried.

Solution

Call the startGuardStrategy API to start the corresponding strategy and then perform the operation again.

1019000009 Parameter Check Failed

Message

Parameter error. Possible causes:1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 3. Parameter verification failed.

Description

  1. A mandatory parameter is left empty.

  2. A parameter type is incorrect.

  3. Parameter verification failed.

Possible causes

  1. A mandatory parameter is not passed.

  2. A parameter type is incorrect. (Type Error)

  3. The number of parameters is incorrect. (Argument Count Error)

  4. Null is passed to a parameter that requires a value. (Null Argument Error)

  5. A parameter format is incorrect. (Format Error)

  6. A parameter value is out of the valid range. (Value Range Error)

Solution

Ensure that all the mandatory parameters are passed in and the parameter types are valid. For parameter verification failures, read the parameter specifications and locate the fault based on the possible causes.

1019000010 API Not Supported on the Device

Message

Capability is not supported on current device.

Description

The device does not support this API. Therefore, it cannot be called properly.

Possible causes

This API is called on a device other than a phone or tablet.

Solution

Avoid using this API on devices other than phones and tablets. Alternatively, add checks to your code to mitigate the impact when the app runs on diverse devices, especially in exception scenarios.

1019000011 Strategy Type Not Supported

Message

The strategy type is not supported.

Description

The API does not support this strategy type. Therefore, it cannot be called properly.

Possible causes

When the queryGuardStrategyData API is called, a strategy that is not of the INCLUSIVE_DURATION_TYPE type is passed.

Solution

Ensure that the strategy passed to the queryGuardStrategyData API is of the INCLUSIVE_DURATION_TYPE type.

Search in References
Enter a keyword.