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 #ifndef DATASHARE_ERRNO_H
17 #define DATASHARE_ERRNO_H
18 
19 namespace OHOS {
20 namespace DataShare {
21 
22 /**
23 * @brief The base code of the exception error code.
24 */
25 constexpr int E_BASE = 1000;
26 
27 /**
28 * @brief The error code for common exceptions.
29 */
30 constexpr int E_ERROR = (E_BASE + 1);
31 
32 /**
33 * @brief The error code for register exceptions.
34 */
35 constexpr int E_REGISTERED_REPEATED = (E_BASE + 2);
36 
37 
38 /**
39 * @brief The error code for register exceptions.
40 */
41 constexpr int E_UNREGISTERED_EMPTY = (E_BASE + 3);
42 
43 /**
44 * @brief The error code for invalid statement.
45 */
46 constexpr int E_INVALID_STATEMENT = (E_BASE + 7);
47 
48 /**
49 * @brief The error code for invalid column index.
50 */
51 constexpr int E_INVALID_COLUMN_INDEX = (E_BASE + 8);
52 
53 /**
54 * @brief The error code for invalid object type.
55 */
56 constexpr int E_INVALID_OBJECT_TYPE = (E_BASE + 20);
57 
58 /**
59 * @brief The error code for invalid parcel.
60 */
61 constexpr int E_INVALID_PARCEL = (E_BASE + 42);
62 
63 /**
64 * @brief The version is smaller than exist.
65 */
66 constexpr int E_VERSION_NOT_NEWER = (E_BASE + 45);
67 
68 /**
69 * @brief Cannot find the template
70 */
71 constexpr int E_TEMPLATE_NOT_EXIST = (E_BASE + 46);
72 
73 /**
74 * @brief Cannot find the subscriber
75 */
76 constexpr int E_SUBSCRIBER_NOT_EXIST = (E_BASE + 47);
77 
78 /**
79 * @brief Cannot find the uri
80 */
81 constexpr int E_URI_NOT_EXIST = (E_BASE + 48);
82 
83 /**
84 * @brief Cannot find the bundleName
85 */
86 constexpr int E_BUNDLE_NAME_NOT_EXIST = (E_BASE + 49);
87 
88 /**
89 * @brief BMS not ready
90 */
91 constexpr int E_BMS_NOT_READY = (E_BASE + 50);
92 
93 /**
94 * @brief metaData not exists
95 */
96 constexpr int E_METADATA_NOT_EXISTS = (E_BASE + 51);
97 /**
98 * @brief silent proxy is disable
99 */
100 constexpr int E_SILENT_PROXY_DISABLE = (E_BASE + 52);
101 /**
102 * @brief token is empty
103 */
104 constexpr int E_TOKEN_EMPTY = (E_BASE + 53);
105 /**
106 * @brief ext uri is empty
107 */
108 constexpr int E_EXT_URI_INVALID = (E_BASE + 54);
109 /**
110 * @brief DataShare not ready
111 */
112 constexpr int E_DATA_SHARE_NOT_READY = (E_BASE + 55);
113 } // namespace DataShare
114 } // namespace OHOS
115 
116 #endif