1 /*
2  * Copyright (c) 2020 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 /**
17  * @addtogroup AbilityKit
18  * @{
19  *
20  * @brief Provides ability-related functions, including ability lifecycle callbacks and functions for connecting to or
21  *        disconnecting from Particle Abilities.
22  *
23  * Abilities are classified into Feature Abilities and Particle Abilities. Feature Abilities support the Page template,
24  * and Particle Abilities support the Service template. An ability using the Page template is called a Page ability for
25  * short and that using the Service template is called a Service ability.
26  *
27  * @since 1.0
28  * @version 1.0
29  */
30 
31 /**
32  * @file ability_errors.h
33  *
34  * @brief Declares error codes returned by ability management functions.
35  *
36  * @since 1.0
37  * @version 1.0
38  */
39 
40 #ifndef OHOS_ABILITY_ERRORS_H
41 #define OHOS_ABILITY_ERRORS_H
42 
43 /**
44 * @brief Declares error codes returned by ability management functions.
45 */
46 enum {
47     /** The function is successfully called. */
48     ERR_OK = 0,
49 
50     /** The parameter is null. */
51     PARAM_NULL_ERROR,
52 
53     /** Memory allocation error. */
54     MEMORY_MALLOC_ERROR,
55 
56     /** An error occurred during the execution of the <b>Dump</b> function. */
57     DUMP_ABILITIES_ERROR,
58 
59     /** IPC request error. */
60     IPC_REQUEST_ERROR,
61 
62     /** Serialization error. */
63     SERIALIZE_ERROR,
64 
65     /** Create app task error. */
66     CREATE_APPTASK_ERROR,
67 
68     /** Scheduler lifecycle error. */
69     SCHEDULER_LIFECYCLE_ERROR,
70 
71     /** The parameter is error. */
72     PARAM_CHECK_ERROR,
73 
74     /** Get callback type error. */
75     GET_CALLBACK_TYPE_ERROR,
76 
77     /** Generate callback local serviceId error. */
78     CALLBACK_GENERATE_LOCAL_SERVICEID_FAILED,
79 
80     /** Command error. */
81     COMMAND_ERROR = 0x7fff,
82 };
83 #endif  // OHOS_ABILITY_ERRORS_H