• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #pragma once
17 
18 #include <cstdint>
19 
20 namespace OHOS::Ace {
21 
22 // Common error code
23 constexpr int32_t ERROR_CODE_NO_ERROR = 0;
24 constexpr int32_t ERROR_CODE_PERMISSION_DENIED = 201; // The application does not have permission to call the interface.
25 // Permission verification failed, application which is not a system application uses system API.
26 constexpr int32_t ERROR_CODE_VERIFICATION_FAILED = 202;
27 constexpr int32_t ERROR_CODE_PARAM_INVALID = 401;     // Invalid input parameter.
28 constexpr int32_t ERROR_CODE_CAPI_INIT_ERROR = 500;     // C-API impl not initialized yet.
29 constexpr int32_t ERROR_CODE_SYSTEMCAP_ERROR = 801;   // The specified SystemCapability names was not found.
30 
31 // Notification error code
32 constexpr int32_t ERROR_CODE_INTERNAL_ERROR = 100001;    // Internal error.
33 constexpr int32_t ERROR_CODE_URI_ERROR = 100002;         // Uri error.
34 constexpr int32_t ERROR_CODE_PAGE_STACK_FULL = 100003;   // The pages are pushed too much.
35 constexpr int32_t ERROR_CODE_NAMED_ROUTE_ERROR = 100004; // Named route error.
36 constexpr int32_t ERROR_CODE_URI_ERROR_LITE = 200002;    // Uri error for lite.
37 
38 // push destination error code
39 constexpr int32_t ERROR_CODE_BUILDER_FUNCTION_NOT_REGISTERED = 100005; // builder function not registered
40 constexpr int32_t ERROR_CODE_DESTINATION_NOT_FOUND = 100006;           // navDestination not found
41 
42 // Send synchronous message error code
43 // No callback has been registered to process synchronous data transferring.
44 constexpr int32_t ERROR_CODE_UIEXTENSION_NOT_REGISTER_SYNC_CALLBACK = 100011;
45 // Transferring data failed
46 constexpr int32_t ERROR_CODE_UIEXTENSION_TRANSFER_DATA_FAILED = 100012;
47 // Forbid cascade uiextension
48 constexpr int32_t ERROR_CODE_UIEXTENSION_FORBID_CASCADE = 100013;
49 // The uiextension ability exited abnormally.
50 constexpr int32_t ERROR_CODE_UIEXTENSION_EXITED_ABNORMALLY = 100014;
51 // The lifecycle of uiextension ability is timeout.
52 constexpr int32_t ERROR_CODE_UIEXTENSION_LIFECYCLE_TIMEOUT = 100015;
53 // The uiextension ability has timed out processing the key event.
54 constexpr int32_t ERROR_CODE_UIEXTENSION_EVENT_TIMEOUT = 100016;
55 // The component not supported prevent function.
56 constexpr int32_t ERROR_CODE_COMPONENT_NOT_SUPPORTED_PREVENT_FUNCTION = 100017;
57 // The uiextension ability foreground failed.
58 constexpr int32_t ERROR_CODE_UIEXTENSION_FOREGROUND_FAILED = 100018;
59 // The uiextension ability background failed.
60 constexpr int32_t ERROR_CODE_UIEXTENSION_BACKGROUND_FAILED = 100019;
61 // The uiextension ability destruction failed.
62 constexpr int32_t ERROR_CODE_UIEXTENSION_DESTRUCTION_FAILED = 100020;
63 // The uiextension transparent node detected.
64 constexpr int32_t ERROR_CODE_UIEXTENSION_TRANSPARENT = 100021;
65 
66 // C-API errors
67 constexpr int32_t ERROR_CODE_NATIVE_IMPL_LIBRARY_NOT_FOUND = 106101;
68 constexpr int32_t ERROR_CODE_NATIVE_IMPL_TYPE_NOT_SUPPORTED = 106102;
69 constexpr int32_t ERROR_CODE_NATIVE_IMPL_BUILDER_NODE_ERROR = 106103;
70 constexpr int32_t ERROR_CODE_NATIVE_IMPL_NODE_ADAPTER_NO_LISTENER_ERROR = 106104;
71 constexpr int32_t ERROR_CODE_NATIVE_IMPL_NODE_ADAPTER_EXIST = 106105;
72 constexpr int32_t ERROR_CODE_NATIVE_IMPL_NODE_ADAPTER_CHILD_NODE_EXIST = 106106;
73 constexpr int32_t ERROR_CODE_NATIVE_IMPL_NODE_EVENT_PARAM_INDEX_OUT_OF_RANGE = 106107;
74 constexpr int32_t ERROR_CODE_NATIVE_IMPL_NODE_EVENT_PARAM_INVALID = 106108;
75 constexpr int32_t ERROR_CODE_NATIVE_IMPL_NODE_EVENT_NO_RETURN = 106109;
76 constexpr int32_t ERROR_CODE_NATIVE_IMPL_NODE_INDEX_INVALID  = 106200;
77 constexpr int32_t ERROR_CODE_NATIVE_IMPL_GET_INFO_FAILED  = 106201;
78 constexpr int32_t ERROR_CODE_NATIVE_IMPL_BUFFER_SIZE_ERROR  = 106202;
79 constexpr int32_t ERROR_CODE_NATIVE_IMPL_NODE_NOT_ON_MAIN_TREE  = 106203;
80 constexpr int32_t ERROR_CODE_NATIVE_IMPL_NODE_ON_INVALID_THREAD = 106204;
81 constexpr int32_t ERROR_CODE_NATIVE_IMPL_NOT_MAIN_THREAD  = 106301;
82 constexpr int32_t ERROR_CODE_NATIVE_IMPL_FORCE_DARK_CONFIG_INVALID = 106205;
83 
84 // C-API RenderNode errors
85 constexpr int32_t ERROR_CODE_NOT_CUSTOM_NODE = 106401;
86 constexpr int32_t ERROR_CODE_CHILD_EXISTED = 106402;
87 constexpr int32_t ERROR_CODE_RENDER_PARENT_EXISTED = 106403;
88 constexpr int32_t ERROR_CODE_CHILD_RENDER_NOT_EXIST = 106404;
89 constexpr int32_t ERROR_CODE_PARAM_OUT_OF_RANGE = 106405;
90 
91 // AI error for Canvas,XComponent
92 constexpr int32_t ERROR_CODE_AI_ANALYSIS_UNSUPPORTED = 110001;
93 constexpr int32_t ERROR_CODE_AI_ANALYSIS_IS_ONGOING = 110002;
94 constexpr int32_t ERROR_CODE_AI_ANALYSIS_IS_STOPPED = 110003;
95 
96 // Drag event error code (190001 ~ 191000)
97 constexpr int32_t ERROR_CODE_DRAG_DATA_NOT_FOUND = 190001;  // GetData failed, data not found.
98 constexpr int32_t ERROR_CODE_DRAG_DATA_ERROR = 190002;      // GetData failed, data error.
99 constexpr int32_t ERROR_CODE_DRAG_DATA_NOT_ONDROP = 190003; // Operation not allowed for current phase.
100 constexpr int32_t ERROR_CODE_DRAG_OPERATION_FAILED = 190004; // Operation failed.
101 
102 // custom dialog error code
103 constexpr int32_t ERROR_CODE_DIALOG_CONTENT_ERROR = 103301;
104 constexpr int32_t ERROR_CODE_DIALOG_CONTENT_ALREADY_EXIST = 103302;
105 constexpr int32_t ERROR_CODE_DIALOG_CONTENT_NOT_FOUND = 103303;
106 constexpr int32_t ERROR_CODE_TARGET_INFO_NOT_EXIST = 103304;
107 constexpr int32_t ERROR_CODE_TARGET_NOT_ON_COMPONENT_TREE = 103305;
108 
109 // toast error code
110 constexpr int32_t ERROR_CODE_TOAST_NOT_FOUND = 103401;
111 
112 // XComponent error code
113 constexpr int32_t ERROR_CODE_XCOMPONENT_STATE_INVALID = 103501;
114 
115 // Video error Code
116 constexpr int32_t ERROR_CODE_VIDEO_CREATE_PLAYER_FAILED = 103601;
117 constexpr int32_t ERROR_CODE_VIDEO_SOURCE_INVALID = 103602;
118 
119 // Canvas error code
120 constexpr int32_t ERROR_CODE_CANVAS_PARAM_INVALID = 103701;
121 
122 // BindSheet error code
123 constexpr int32_t ERROR_CODE_BIND_SHEET_CONTENT_ERROR = 120001;
124 constexpr int32_t ERROR_CODE_BIND_SHEET_CONTENT_ALREADY_EXIST = 120002;
125 constexpr int32_t ERROR_CODE_BIND_SHEET_CONTENT_NOT_FOUND = 120003;
126 constexpr int32_t ERROR_CODE_TARGET_ID_NOT_EXIST = 120004;
127 constexpr int32_t ERROR_CODE_TARGET_NOT_ON_MAIN_TREE = 120005;
128 constexpr int32_t ERROR_CODE_TARGET_NOT_PAGE_CHILD = 120006;
129 
130 // RequestFocus error code (150001 ~ 151000)
131 constexpr int32_t ERROR_CODE_NON_FOCUSABLE = 150001;
132 constexpr int32_t ERROR_CODE_NON_FOCUSABLE_ANCESTOR = 150002;
133 constexpr int32_t ERROR_CODE_NON_EXIST = 150003;
134 
135 // ComponentSnapshot error code (160001 ~ 161000), 1610001 ~ 163000 reserved
136 constexpr int32_t ERROR_CODE_COMPONENT_SNAPSHOT_IMAGE_LOAD_ERROR = 160001;
137 constexpr int32_t ERROR_CODE_COMPONENT_SNAPSHOT_TIMEOUT = 160002;
138 // observer node render state error code
139 constexpr int32_t NODE_RENDER_STATE_REGISTER_ERR_CODE = 161001;
140 
141 // FromHtml error code
142 constexpr int32_t ERROR_CODE_FROM_HTML_CONVERT_ERROR = 170001;
143 constexpr int32_t ERROR_CODE_STYLED_STRING_CONVERT_ERROR = 170002;
144 
145 // Gesture error code (180001 ~ 181000)
146 constexpr int32_t ERROR_CODE_NON_SCROLLABLE_CONTAINER = 180001;
147 constexpr int32_t ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH = 180002;
148 constexpr int32_t ERROR_INPUT_EVENT_TYPE_NOT_SUPPORT = 180006;
149 } // namespace OHOS::Ace
150