• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Utils 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## 10200001 Value Out of Range
8
9**Error Message**
10
11The value of ${param} is out of range.
12
13**Description**
14
15The value of a parameter passed in the API exceeds the valid range.
16
17**Possible Causes**
18
19The parameter value exceeds the value range.
20
21**Solution**
22
23Use a valid parameter value.
24
25## 10200002 Parameter Parsing Error
26
27**Error Message**
28
29Invalid ${param} string.
30
31**Description**
32
33Failed to parse a string.
34
35**Possible Causes**
36
37A parameter of the string type passed in the API is a non-standard string. As a result, the string fails to be parsed.
38
39**Solution**
40
41Check the format of the string.
42
43## 10200003 Failed to Initialize the Worker Instance
44
45**Error Message**
46
47Worker initialization failure.
48
49**Description**
50
51The **Worker** instance fails to be initialized when the API is called.
52
53**Possible Causes**
54
551. The number of **Worker** instances to be created exceeds the upper limit.
562. The options for setting the **Worker** instance are incorrect.
57
58**Solution**
59
601. Check whether the number of **Worker** instances exceeds 8. If yes, destroy idle **Worker** instances.
612. If **WorkerOptions** is set, check the parameter type and validity.
62
63## 10200004 Worker Instance Is Not Running
64
65**Error Message**
66
67Worker instance is not running.
68
69**Description**
70
71The **Worker** instance is not running when the API is called.
72
73**Possible Causes**
74
75When the API is called, the **Worker** instance has been destroyed or is being destroyed.
76
77**Solution**
78
79Ensure that the **Worker** instance is running properly.
80
81## 10200005 API Not Supported in the Worker Thread
82
83**Error Message**
84
85The invoked API is not supported in workers.
86
87**Description**
88
89An API that is not supported by the worker thread is called.
90
91**Possible Causes**
92
93The worker thread does not support the API.
94
95**Solution**
96
97Use a supported API.
98
99## 10200006 Worker Transmission Information Serialization Exception
100
101**Error Message**
102
103An exception occurred during serialization.
104
105**Description**
106
107An error occurs when serializing transmission information.
108
109**Possible Causes**
110
111The transmission information is not serializable.
112
113**Solution**
114
115Use transmission information that is a valid serialized object.
116
117## 10200007 Abnormal Worker File Path
118
119**Error Message**
120
121The worker file path is invalid.
122
123**Description**
124
125The file path is invalid, and the **Worker** instance cannot be loaded.
126
127**Possible Causes**
128
129The worker file path is invalid. As a result, a valid **worker.abc** file cannot be generated during the build.
130
131**Solution**
132
133Ensure that the worker file path complies with the specifications for creating **Worker** instances. For details, see the example under [constructor<sup>9+</sup>](../apis/js-apis-worker.md#constructor9).
134
135## 10200009 Buffer Size Error
136
137**Error Message**
138
139Buffer size must be a multiple of ${size}.
140
141**Description**
142
143The buffer size does not meet the requirement.
144
145**Possible Causes**
146
147The buffer size is not an integer multiple of **size**, which can be 16-bit, 32-bit, or 64-bit.
148
149**Solution**
150
151Use a buffer the size of which meets the requirements.
152
153
154## 10200010 Empty Container
155
156**Error Message**
157
158The container is empty.
159
160**Description**
161
162The container to be operated is empty.
163
164**Possible Causes**
165
166No element is added to the container.
167
168**Solution**
169
170Add elements to the container first.
171
172## 10200011 Passed this.object Is Not an Instance of the containers Class
173
174**Error Message**
175
176The {methodName} method cannot be bound.
177
178**Description**
179
180**this.object** passed in the API is not an instance of the **containers** class.
181
182**Possible Causes**
183
184The APIs of the **containers** class do not support **bind()**.
185
186**Solution**
187
1881. Check whether **bind()** is used to call the API.
1892. Check whether an object that is not a container instance is assigned to the API.
190
191## 10200012 Constructor Calling Failure
192
193**Error Message**
194
195The {className}'s constructor cannot be directly invoked.
196
197**Description**
198
199A constructor of the **containers** class is called directly to create an instance.
200
201**Possible Causes**
202
203The constructors of the **containers** class cannot be directly called. The keyword **new** must be used.
204
205**Solution**
206
207Use the keyword **new** to create an instance.
208
209## 10200013 Read-Only Property
210
211**Error Message**
212
213Cannot set property ${propertyName} of Buffer which has only a getter.
214
215**Description**
216
217The buffer ${propertyName} is read-only and cannot be set.
218
219**Possible Causes**
220
221The buffer is read-only.
222
223**Solution**
224
225Do not set the read-only attribute for the buffer.
226
227## 10200014 Non-Concurrent Function Error
228
229**Error Message**
230
231The function is not mark as concurrent.
232
233**Description**
234
235The function is not marked as **concurrent**.
236
237**Possible Causes**
238
239**@Concurrent** is not added to the function required by the task to be executed in the task pool.
240
241**Solution**
242
243Check the functions required by the tasks executed by the task pool and add the **@Concurrent** decorator.
244
245## 10200015 Failed to Cancel a Task That Does Not Exist
246
247**Error Message**
248
249The task does not exist when it is canceled.
250
251**Description**
252
253This error code is reported when you attempt to cancel a task that does not exist.
254
255**Possible Causes**
256
257The task to cancel does not exist in the task pool.
258
259**Solution**
260
261Before canceling a task, ensure that the task has been placed in the task pool by calling [taskpool.execute](../apis/js-apis-taskpool.md#taskpoolexecute-1) and is not finishing. If you are not sure, capture exceptions.
262
263## 10200016 Failed to Cancel a Task Being Executed
264
265**Error Message**
266
267The task is executing when it is canceled.
268
269**Description**
270
271This error code is reported when you attempt to cancel a task that is being executed.
272
273**Possible Causes**
274
275The task to cancel is being executed.
276
277**Solution**
278
279Before canceling a task, ensure that the task has been placed in the task pool by calling [taskpool.execute](../apis/js-apis-taskpool.md#taskpoolexecute-1) and has not started execution. If you are not sure, capture exceptions.
280
281## 10200017 Failed to Delete an Element That Does Not Exist
282
283**Error Message**
284
285The element does not exist in this container.
286
287**Description**
288
289This error code is reported when you attempt to delete an element that does not exist in the container.
290
291**Possible Causes**
292
293The element to delete does not exist in the container.
294
295**Solution**
296
297Before deleting an element, ensure that the element exists in this container.
298
299## 10200018 Failed to Cancel a Task Group That Does Not Exist
300
301**Error Message**
302
303The task group does not exist when it is canceled.
304
305**Description**
306
307This error code is reported when you attempt to cancel a task group that does not exist.
308
309**Possible Causes**
310
311The task group to cancel does not exist in the task pool.
312
313**Solution**
314
315Before canceling a task group, ensure that the task group placed in the task pool by calling [taskpool.execute](../apis/js-apis-taskpool.md#taskpoolexecute10) and is not finishing. If you are not sure, capture exceptions.
316
317## 10200019 Failed to Call an API of an Unregistered Object
318
319**Error Message**
320
321The globalCallObject is not registered.
322
323**Description**
324
325This error code is reported when you attempt to call an API of an object that is not registered.
326
327**Possible Causes**
328
329The object with the specified name is not registered or has been destroyed on the **Worker** instance of the host thread.
330
331**Solution**
332
333Do not call the API on the object that is not registered or has been destroyed. If the registration or destruction status cannot be determined, use the try-catch mechanism to call the API.
334
335## 10200020 Failed to Call an API of a Registered Object
336
337**Error Message**
338
339The method to be called is not callable or is an async method or a generator.
340
341**Description**
342
343This error code is reported when you attempt to call an API of an incorrect type on a registered object.
344
345**Possible Causes**
346
347The attribute contained in the object is not callable, the method contained in the object is asynchronous, or the object is returned by the generator function.
348
349**Solution**
350
351Ensure that the attribute contained in the method is callable and that the method itself or its underlying layer is not asynchronous.
352
353## 10200021 Waiting for a Global Call Times Out
354
355**Error Message**
356
357The global call exceededs the timeout.
358
359**Description**
360
361This error code is reported when a global call does not return any value within the specified duration.
362
363**Possible Causes**
364
365The global call does not return any value within the specified duration, which is 5000 ms by default.
366
367**Solution**
368
369Do not call APIs that take a long time to process data, such as complex computing and file read/write. Otherwise, worker threads will be blocked for a long time, resulting in poor running performance.
370
371## 10200022 Functions Not Called in TaskPool
372
373**Error Message**
374
375The function is not called in the taskpool thread.
376
377**Description**
378
379This error code is reported when the function is not called in a **TaskPool** thread.
380
381**Possible Causes**
382
383The function is called in the main thread or in a thread that is not in **TaskPool**.
384
385**Solution**
386
387Ensure that concurrent functions are executed in a **TaskPool** thread. If you are not sure, capture exceptions.
388
389## 10200023 Functions Not Called in Concurrent Functions
390
391**Error Message**
392
393The function is not called in the concurrent function.
394
395**Description**
396
397This error code is reported when the function is not called in a concurrent function.
398
399**Possible Causes**
400
401The function is called in a callback function.
402
403**Solution**
404
405Ensure that the function is called in a concurrent function. If you are not sure, capture exceptions.
406
407## 10200024 Functions Not Registered in the Host Thread
408
409**Error Message**
410
411The callback is not registered on the host side.
412
413**Description**
414
415This error code is reported when this function is called without registering a callback in the host thread.
416
417**Possible Causes**
418
419This function is called without registering a callback in the host thread.
420
421**Solution**
422
423Ensure that the callback has been registered in the host thread before this function is called. If you are not sure, capture exceptions.
424
425## 10200025 Failed to Add a Task with Dependent Tasks to the Queue
426
427**Error Message**
428
429Add dependent task to SequenceRunner.
430
431**Description**
432
433A task that has dependent tasks cannot be added to the queue.
434
435**Possible Causes**
436
437The task to be added to the queue has dependent tasks.
438
439**Solution**
440
441Call [removeDependency()](../apis/js-apis-taskpool.md#removedependency11) to remove the dependent tasks first.
442
443## 10200026 Task with a Cyclic Dependency
444
445**Error Message**
446
447There is a circular dependency.
448
449**Description**
450
451The current task has a cyclic dependency.
452
453**Possible Causes**
454
455The current task has a cyclic dependency.
456
457**Solution**
458
459Call [removeDependency()](../apis/js-apis-taskpool.md#removedependency11) to remove unnecessary dependencies.
460
461## 10200027 Dependency Does Not Exist
462
463**Error Message**
464
465The dependency does not exist.
466
467**Description**
468
469[removeDependency()](../apis/js-apis-taskpool.md#removedependency11) is called to remove a dependent task, but the task does not exist.
470
471**Possible Causes**
472
473The dependent task to remove does not exist.
474
475**Solution**
476
477Ensure that the dependent task to remove has been added by using [addDependency()](../apis/js-apis-taskpool.md#adddependency11). If you are not sure, capture exceptions.
478
479## 10200028 Delay Less Than Zero
480
481**Error Message**
482
483The delayTime is less than zero.
484
485**Description**
486
487This error code is reported when the value of [delayTime](../apis/js-apis-taskpool.md#taskpoolexecutedelayed11) is less than 0.
488
489**Possible Causes**
490
491The value of [delayTime](../apis/js-apis-taskpool.md#taskpoolexecutedelayed11) is less than 0.
492
493**Solution**
494
495Ensure that [delayTime](../apis/js-apis-taskpool.md#taskpoolexecutedelayed11) is set to a value greater than 0. If you are not sure, capture exceptions.
496
497## 10200029 ArrayBuffer Cannot Be Set as Both TransferList and CloneList
498
499**Error Message**
500
501Can not set an arraybuffer to both transferList and cloneList.
502
503**Description**
504
505An ArrayBuffer cannot be set as both a transfer list and a clone list.
506
507**Possible Causes**
508
509During the transmission of a shared list, an ArrayBuffer is a parameter of both [setTransferList](../apis/js-apis-taskpool.md#settransferlist10) and [setCloneList](../apis/js-apis-taskpool.md#setclonelist11).
510
511**Solution**
512
513Ensure that an ArrayBuffer is set as either a transfer list or clone list. If you are not sure, capture exceptions.
514