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 failed. 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 67The Worker 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 called API is not supported in the worker thread. 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 Data Serialization Exception 100 101**Error Message** 102 103An exception occurred during serialization. 104 105**Description** 106 107An error occurs during serialization. 108 109**Possible Causes** 110 111The type of data to transfer does not support serialization or is imported externally. 112 113**Solution** 114 115Ensure that the data to transfer is a valid serialized object supported by Worker. For details, see [ArkTS Inter-Thread Communication Overview](../../arkts-utils/interthread-communication-overview.md). 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>](js-apis-worker.md#constructor9). 134 135## 10200009 Buffer Size Error 136 137**Error Message** 138 139The buffer 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 213${propertyName} cannot be set for the buffer that 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 marked 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 to cancel does not exist. 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](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 to cancel is being executed. 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](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 to cancel does not exist. 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](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 357Waiting for a global call timed out. 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 UI 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 429dependent task not allowed. 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()](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()](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()](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()](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](js-apis-taskpool.md#taskpoolexecutedelayed11) is less than 0. 488 489**Possible Causes** 490 491The value of [delayTime](js-apis-taskpool.md#taskpoolexecutedelayed11) is less than 0. 492 493**Solution** 494 495Ensure that [delayTime](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 501An ArrayBuffer cannot be set as both a transfer list and a clone list. 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](js-apis-taskpool.md#settransferlist10) and [setCloneList](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 515## 10200030 Lock Does Not Exist 516 517**Error Message** 518 519The lock does not exist. 520 521**Description** 522 523The requested lock does not exist. 524 525**Possible Causes** 526 527An asynchronous lock function uses an incorrect lock name. 528 529**Solution** 530 531Ensure that the correct lock name is used when the API is called. 532 533## 10200031 Calling lockAsync Timed Out 534 535**Error Message** 536 537Timeout exceeded. 538 539**Description** 540 541The [lockAsync](js-apis-arkts-utils.md#lockasync) API fails to acquire a lock within the specified period. 542 543**Possible Causes** 544 545A deadlock occurs somewhere. 546 547**Solution** 548 549Check whether a circular dependency exists between locks. Add the **catch** statement to the [lockAsync](js-apis-arkts-utils.md#lockasync) call to catch error information, which contains information about existing asynchronous lock instances and possible deadlock warnings. 550 551## 10200201 Concurrent Modification Error 552 553**Error Message** 554 555Concurrent modification error. 556 557**Description** 558 559An error occurs during concurrent modification. 560 561**Possible Causes** 562 563A non-concurrent-safe container provided by **collections** is used, and the result generated when multiple concurrent instances simultaneously modify the container is undefined. 564 565**Solution** 566 567Use asynchronous locks in non-concurrent-safe containers provided by **collections**. 568 569## 10200034 No Callback Function Is Registered for a Listening Task 570 571**Error Message** 572 573The executed task does not support the registration of listeners. 574 575**Description** 576 577The task does not support listener registration. 578 579**Possible Causes** 580 581The callback function is not registered or is registered after the task is executed. 582 583**Solution** 584 585Ensure that the callback function is registered before the task is executed. 586 587## 10200035 doWrite Is Not Implemented 588 589**Error Message** 590 591The doWrite method has not been implemented. 592 593**Description** 594 595The **doWrite** API is not implemented. 596 597**Possible Causes** 598 599The code inherits from the **Writable** class, but does not implement the [doWrite](js-apis-stream.md#dowrite) API. 600 601**Solution** 602 603Implement the **doWrite** API in the inherited class. 604 605## 10200036 Write Operation Is Still Performed After the Stream Ends 606 607**Error Message** 608 609The stream has been ended. 610 611**Description** 612 613The write operation is still performed after the stream ends. 614 615**Possible Causes** 616 617Data is written after the [end](js-apis-stream.md#end) API is called. 618 619**Solution** 620 621Adjust the sequence in which the APIs are called to ensure that no write operation is performed after [end](js-apis-stream.md#end). 622 623## 10200037 Callback Is Invoked Multiple Times 624 625**Error Message** 626 627The callback is invoked multiple times consecutively. 628 629**Description** 630 631The callback is invoked multiple times. 632 633**Possible Causes** 634 635In the [doWrite](js-apis-stream.md#dowrite) implementation code, the callback is invoked multiple times for one write operation. 636 637**Solution** 638 639Check the implementation of [doWrite](js-apis-stream.md#dowrite) and exclude the situation where the callback is invoked multiple times for one write operation. 640 641## 10200038 doRead Is Not Implemented 642 643**Error Message** 644 645The doRead method has not been implemented. 646 647**Description** 648 649The **doRead** API is not implemented. 650 651**Possible Causes** 652 653The code inherits from the **Readable** class, but does not implement the [doRead](js-apis-stream.md#doread) API. 654 655**Solution** 656 657Implement the **doRead** API in the inherited class. 658 659## 10200039 doTransform Is Not Implemented 660 661**Error Message** 662 663The doTransform method has not been implemented for a class that inherits from Transform. 664 665**Description** 666 667The **doTransform** API is not implemented. 668 669**Possible Causes** 670 671The code inherits from the **Transform** class, but does not implement the [doTransform](js-apis-stream.md#dotransform) API. 672 673**Solution** 674 675Implement the **doTransform** API in the inherited class. 676 677## 10200050 Concurrent Task That Has Been Executed Cannot Be Executed Periodically 678 679**Error Message** 680 681The concurrent task has been executed and cannot be executed periodically. 682 683**Description** 684 685The concurrent task that has been executed cannot be executed periodically. 686 687**Possible Causes** 688 689The task has been executed before [executePeriodically](../apis-arkts/js-apis-taskpool.md#taskpoolexecuteperiodically12) is called. 690 691**Solution** 692 693Before calling the API, ensure that the task is not executed. If you are not sure, capture exceptions. 694 695## 10200051 Periodic Task Cannot Be Executed Again 696 697**Error Message** 698 699The periodic task cannot be executed again. 700 701**Description** 702 703A periodic task cannot be executed again. 704 705**Possible Causes** 706 707[execute](../apis-arkts/js-apis-taskpool.md#execute11), [executeDelayed](../apis-arkts/js-apis-taskpool.md#taskpoolexecutedelayed11), [addTask](../apis-arkts/js-apis-taskpool.md#addtask10-1), or [execute](../apis-arkts/js-apis-taskpool.md#taskpoolexecute-1) is called again to execute a periodic call. 708 709**Solution** 710 711Before calling these APIs, ensure that the task is not a periodic task. If you are not sure, capture exceptions. 712 713## 10200052 Periodic Task Cannot Have Dependencies 714 715**Error Message** 716 717The periodic task cannot have a dependency. 718 719**Description** 720 721A periodic task cannot have dependencies. 722 723**Possible Causes** 724 725[removeDependency](../apis-arkts/js-apis-taskpool.md#removedependency11) or [addDependency](js-apis-taskpool.md#adddependency11) is called to remove or add dependencies for a periodic task. 726 727**Solution** 728 729Before calling these APIs, ensure that the task is not a periodic task. If you are not sure, capture exceptions. 730 731## 10200060 Precision Limit Is Exceeded 732 733**Error Message** 734 735Precision limit exceeded. 736 737**Description** 738 739A **Decimal** function is incorrectly used. 740 741**Possible Causes** 742 743The precision of the function provided by **Decimal** exceeds the limit. This error code may be thrown by the following functions: [pow](js-apis-arkts-decimal.md#pow), [exp](js-apis-arkts-decimal.md#exp), [log](js-apis-arkts-decimal.md#log), [ln](js-apis-arkts-decimal.md#ln), [acos](js-apis-arkts-decimal.md#acos), [asin](js-apis-arkts-decimal.md#asin), [atan](js-apis-arkts-decimal.md#atan), [acosh](js-apis-arkts-decimal.md#acosh), [asinh](js-apis-arkts-decimal.md#asinh), [atanh](js-apis-arkts-decimal.md#atanh), [log2](js-apis-arkts-decimal.md#log2), [log10](js-apis-arkts-decimal.md#log10), and [atan2](js-apis-arkts-decimal.md#atan2). 744 745**Solution** 746 747Use [Decimal.set](js-apis-arkts-decimal.md#set) to set a valid precision. 748 749Example: Decimal.set({precision: 10}) 750 751## 10200061 Encryption Method Is Unavailable 752 753**Error Message** 754 755crypto unavailable. 756 757**Description** 758 759A **Decimal** function is incorrectly used. 760 761**Possible Causes** 762 763When [crypto](js-apis-arkts-decimal.md#decimalconfig) of **Decimal** is set or the [Decimal.random](js-apis-arkts-decimal.md#random) function is used, the encryption method fails to be used. 764 765**Solution** 766 767Use [Decimal.set](js-apis-arkts-decimal.md#set) to cancel the encryption algorithm. 768 769Example: Decimal.set({crypto: false}) 770