• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# DataShare Error Codes
2
3> **NOTE**
4>
5> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](../errorcode-universal.md).
6
7##  15700000 Internal Error
8
9**Error Message**
10
11Inner error.
12
13**Description**
14
15Internal error.
16
17**Possible Causes**
18
19View the error log to determine the cause of the error. Possible causes include the following:
201. Abnormal internal state.
212. Incorrect use of APIs.
223. Incorrect permission configuration.
234. System errors, such as null pointers, insufficient memory, unexpected restart of data services, I/O errors, IPC exceptions, and JS engine exceptions.
24
25**Solution**
26
271. Check whether a closed object is reused.
282. Check whether the APIs are called correctly. If not, apply necessary corrections.
293. Check whether the permission configuration is correct.
304. If the problem persists, ask the user to restart or update the application or upgrade the device version.
31
32## 15700010 Failed to Create a DataShareHelper
33
34**Error Message**
35
36The DataShareHelper is not initialized successfully.
37
38**Description**
39
40The **DataShareHelper** class fails to be created.
41
42**Possible Causes**
43
441. The **uri** specified in **createDataHelper** is incorrect.
452. The **context** specified in **createDataHelper** is incorrect. **DataShare** supports only the stage model.
463. The client application does not have the permission to start **DataShareExtension** from the background when the client attempts to start **DataShareExtension** from the background to create **DataShareHelper**.
47
48**Solution**
49
501. Obtain the correct URI.
512. Check that the context of the stage model is used.
523. Check whether the client has the read or write permission on data. Perform the following steps:
53    (1) Obtain the data provider bundle name from the URI. For example, the bundle name in uri "datashareproxy://com.acts.ohos.data.datasharetest/test" is **com.acts.ohos.data.datasharetest**.
54    (2) Obtain the configuration based on the bundle name. For example, run **bm dump --bundle-name com.acts.ohos.data.datasharetest** to obtain the **DataShareExtension** configuration, and check whether the data consumer has **readPermission** or **writePermission**.
55
56## 15700011 URI Not Exist
57
58**Error Message**
59
60The URI does not exist.
61
62**Description**
63
64This error code is generated when a template fails to be added or deleted, or an incorrect URI or path is passed in when silent access is enabled or disabled.
65
66**Possible Causes**
67
681. The input URI is incorrect.
692. The input URI is in incorrect format.
70
71**Solution**
72
73Obtain the correct URI.
74
75## 15700012 Data Area Not Exist
76
77**Error Message**
78
79The data area does not exist.
80
81**Description**
82
83This error code is returned when a data update fails.
84
85**Possible Causes**
86
87The input parameter **bundleName** of **publish()** is incorrect.
88
89**Solution**
90
91Obtain the correct **bundleName** value from the DataShare server provider.
92
93## 15700013 DataShareHelper Instance Closed
94
95**Error Message**
96
97The DataShareHelper instance is already closed.
98
99**Description**
100
101This error code is generated when a closed **DataShareHelper** instance is used.
102
103**Possible Causes**
104
105The closed **DataShareHelper** instance cannot be used.
106
107**Solution**
108
109Create a new **DataShareHelper** instance for use.
110