• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Webview 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## 17100001 WebviewController Not Associated with a Web Component
8
9**Error Message**
10
11Init error. The WebviewController must be associated with a Web component.
12
13**Description**
14
15This error code is reported when the **WebviewController** object is not associated with any **Web** component.
16
17**Solution**
18
19Use [onControllerAttached()](./arkts-basic-components-web-events.md#oncontrollerattached10) to check whether the **WebViewController** object is attached with the **Web** component.
20
21
22## 17100002 Invalid URL
23
24**Error Message**
25
26URL error. Possible causes: 1. No valid cookie found for the specified URL. 2. The webpage corresponding to the URL is invalid, or the URL length exceeds 2048.
27
28**Description**
29
30The URL is incorrect. Possible causes are as follows:
31
321. No valid cookie is found for the specified URL.
33
342. The web page corresponding to the URL is invalid, or the URL length exceeds 2048 characters.
35
36**Solution**
37
38Check whether the URL is correct and contains a maximum of 2048 characters.
39
40
41## 17100003 Incorrect Resource Path
42
43**Error Message**
44
45Invalid resource path or file type.
46
47**Description**
48
49This error code is reported when the path to the resource file is incorrect.
50
51**Possible Causes**
52
53The resource file does not exist or cannot be accessed.
54
55**Solution**
56
57Make sure the path to the resource file is correct.
58
59
60## 17100004 Function Not Enabled
61
62**Error Message**
63
64Function not enabled.
65
66**Description**
67
68This error code is reported when the related function is not enabled.
69
70**Solution**
71
72Make sure the related function is enabled.
73
74
75## 17100005 Invalid Cookie Value
76
77**Error Message**
78
79The provided cookie value is invalid. It must follow the format specified in RFC 6265.
80
81**Description**
82
83This error code is reported when the cookie value type is invalid.
84
85**Possible Causes**
86
87The cookie value type is not supported.
88
89**Solution**
90
91Verify the cookie value type.
92
93
94## 17100006 Message Port Callback Cannot Be Registered
95
96**Error Message**
97
98Failed to register a message event for the port.
99
100**Description**
101
102This error code is reported when a callback fails to be registered for the message port.
103
104**Possible Causes**
105
106The port is closed.
107
108**Solution**
109
110Make sure the port is open.
111
112
113## 17100008 javaScriptProxy Does Not Exist
114
115**Error Message**
116
117Failed to delete JavaScriptProxy because it does not exist.
118
119**Description**
120
121This error code is reported when the **javaScriptProxy** object to delete does not exist.
122
123**Possible Causes**
124
125The target **javaScriptProxy** object is not yet registered.
126
127**Solution**
128
129Make sure the **javaScriptProxy** object is registered.
130
131
132## 17100010 Failure to Send Messages Through a Port
133
134**Error Message**
135
136Failed to post messages through the port.
137
138**Description**
139
140This error code is reported when the current port cannot be used to send messages.
141
142**Possible Causes**
143
144The local or remote port is closed.
145
146**Solution**
147
1481. Make sure the local port is open.
149
1502. Make sure an **onMessageEvent** callback is registered for the remote port.
151
152
153## 17100011 Invalid Origin
154
155**Error Message**
156
157Invalid origin.
158
159**Description**
160
161This error code is reported when the input parameter **origin** is invalid.
162
163**Possible Causes**
164
1651. The **origin** parameter is empty.
166
1672. The **origin** value is invalid.
168
169**Solution**
170
171Make sure the **origin** value is valid.
172
173
174## 17100012 No Web Storage Origin
175
176**Error Message**
177
178Invalid web storage origin.
179
180**Description**
181
182This error code is reported when no web storage origin is available.
183
184**Possible Causes**
185
186The related JS database API is not used.
187
188**Solution**
189
1901. Check whether the JS database API is used.
191
1922. If the JS database API is used, find out the failure cause, for example, check whether **databaseAccess** is enabled.
193
194
195## 17100013 Invalid Number of Sockets During Preconnection
196
197**Error Message**
198
199The number of sockets to be preconnected is invalid.
200
201**Description**
202
203This error code is reported when the number of sockets to be preconnected is invalid.
204
205**Possible Causes**
206
207The number of sockets is less than or equal to 0 or greater than 6.
208
209**Solution**
210
211Make sure the specified number of sockets is greater than 0 and less than or equal to 6.
212
213
214## 17100014 Type and Value Mismatch
215
216**Error Message**
217
218The type and value of the message do not match.
219
220**Description**
221
222This error code is reported when the type and value of the message do not match.
223
224**Possible Causes**
225
226The value of the obtained message does not match the type of the message.
227
228**Solution**
229
230Call the API based on the message type to obtain the message value. For example, if the type is **BOOLEAN**, call the **GetBoolean** API to obtain the Boolean value.
231
232
233## 17100016 Download Task Not Paused
234
235**Error Message**
236
237The download task is not paused.
238
239**Description**
240
241This error code is reported when an attempt is made to resume a download task that is not paused.
242
243**Possible Causes**
244
245**WebDownloadItem.resume** is called when the download task is not paused.
246
247**Solution**
248
249N/A
250
251
252## 17100018 No WebDownloadDelegate Available
253
254**Error Message**
255
256No WebDownloadDelegate has been set yet.
257
258**Description**
259
260This error code is reported when no **WebDownloadDelegate** is available to receive the download state.
261
262**Possible Causes**
263
264**WebDownloadManager.resumeDownload** is called when **WebDownloadDelegate** has not been set.
265
266**Solution**
267
268Use **WebDownloadManager.setDownloadDelegate** to set a **WebDownloadDelegate** class.
269
270## 17100019 Download Not Started Yet
271
272**Error Message**
273
274The download task is not started yet.
275
276**Description**
277
278This error code is reported when an attempt is made to pause or resume a download task that has not been started.
279
280**Possible Causes**
281
282**pause** or **resume** is called when the download task that has not been started.
283
284**Solution**
285
286Call **start('xxx')** in **WebDownloadDelegate.onBeforeDownload** and specify the download path.
287
288## 17100020 Failed to Register Custom Schemes
289
290**Error Message**
291
292Failed to register custom schemes.
293
294**Description**
295
296This error code is reported when a custom scheme failed to be registered.
297
298**Possible Causes**
299
300The custom scheme is set after the ArkWeb engine is initialized.
301
302**Solution**
303
304Register the custom scheme before initializing the ArkWeb engine.
305
306## 17100021 WebResourceHandler Is Invalid
307
308**Error Message**
309
310The resource handler is invalid.
311
312**Description**
313
314This error code is reported when the **WebResourceHandler** object is invalid.
315
316**Possible Causes**
317
3181. The corresponding request is not intercepted in **WebSchemeHandler**.
319
3202. The request is intercepted before the response body is constructed, and the request is ended due to some reasons.
321
3223. The **WebResourceHandler** object has called **didFinish** and **didFail**.
323
324
325**Solution**
326
327Do not call the **WebResourceHandler** API in the preceding situations.
328
329## 17100022 Failed to Initialize WebHttpBodyStream
330
331**Error Message**
332
333Failed to initialize the HTTP body stream.
334
335**Description**
336
337This error code is reported when data initialization of **WebHttpBodyStream** fails.
338
339**Possible Causes**
340
341The data carried in the POST request is invalid, for example, the data flow contains data in a file but the specified file path does not exist.
342
343**Solution**
344
345Verify that the data carried in the POST request is valid.
346
347## 17100023 Port Number Not Allowed
348
349**Error Message**
350
351The port number is not within the allowed range.
352
353**Description**
354
355The port number is not within the allowed range.
356
357**Possible Causes**
358
359Some port numbers (for example, port numbers less than 1024) are well-known or system ports. These ports can be enabled on the operating system only when the privilege is granted. Therefore, applications are not allowed to use these port numbers.
360
361**Solution**
362
363Check whether the port number is within the allowed range.
364
365## 17100101 Incorrect Network Error Code
366
367**Error Message**
368
369The errorCode is either ARKWEB_NET_OK or outside the range of error codes in WebNetErrorList.
370
371**Description**
372
373The network error code is **ARKWEB_NET_OK** or out of the range in **WebNetErrorList**.
374
375**Possible Causes**
376
377The error code is not within the range of [WebNetErrorList](arkts-apis-netErrorList.md#webneterrorlist), or **NET_OK** is used when the **didFail** API is called.
378
379**Solution**
380
381Check whether the error code is within the range of [WebNetErrorList](arkts-apis-netErrorList.md#webneterrorlist) or whether **NET_OK** is used when the **difFail** API is called.
382