• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 error code in the correct case.
24 */
25 constexpr int E_OK = 0;
26 
27 /**
28 * @brief The base code of the exception error code.
29 */
30 constexpr int E_BASE = 1000;
31 
32 /**
33 * @brief The error code for common exceptions.
34 */
35 constexpr int E_ERROR = (E_BASE + 1);
36 
37 /**
38 * @brief The error code for register exceptions.
39 */
40 constexpr int E_REGISTERED_REPEATED = (E_BASE + 2);
41 
42 
43 /**
44 * @brief The error code for register exceptions.
45 */
46 constexpr int E_UNREGISTERED_EMPTY = (E_BASE + 3);
47 
48 /**
49 * @brief The error code for invalid statement.
50 */
51 constexpr int E_INVALID_STATEMENT = (E_BASE + 7);
52 
53 /**
54 * @brief The error code for invalid column index.
55 */
56 constexpr int E_INVALID_COLUMN_INDEX = (E_BASE + 8);
57 
58 /**
59 * @brief The error code for invalid object type.
60 */
61 constexpr int E_INVALID_OBJECT_TYPE = (E_BASE + 20);
62 
63 /**
64 * @brief The error code for invalid parcel.
65 */
66 constexpr int E_INVALID_PARCEL = (E_BASE + 42);
67 
68 /**
69 * @brief The version is smaller than exist.
70 */
71 constexpr int E_VERSION_NOT_NEWER = (E_BASE + 45);
72 
73 /**
74 * @brief Cannot find the template
75 */
76 constexpr int E_TEMPLATE_NOT_EXIST = (E_BASE + 46);
77 
78 /**
79 * @brief Cannot find the subscriber
80 */
81 constexpr int E_SUBSCRIBER_NOT_EXIST = (E_BASE + 47);
82 
83 /**
84 * @brief Cannot find the uri
85 */
86 constexpr int E_URI_NOT_EXIST = (E_BASE + 48);
87 
88 /**
89 * @brief Cannot find the bundleName
90 */
91 constexpr int E_BUNDLE_NAME_NOT_EXIST = (E_BASE + 49);
92 } // namespace DataShare
93 } // namespace OHOS
94 
95 #endif