1 /*
2 * Copyright (c) 2023 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 DOC_ERRNO_H
17 #define DOC_ERRNO_H
18 
19 namespace DocumentDB {
20 constexpr int E_OK = 0;
21 constexpr int E_BASE = 1000;
22 constexpr int E_ERROR = E_BASE + 1;
23 constexpr int E_INVALID_ARGS = E_BASE + 2;
24 constexpr int E_UNFINISHED = E_BASE + 7;
25 constexpr int E_OUT_OF_MEMORY = E_BASE + 8;
26 constexpr int E_SECUREC_ERROR = E_BASE + 9;
27 constexpr int E_SYSTEM_API_FAIL = E_BASE + 10;
28 constexpr int E_FILE_OPERATION = E_BASE + 11;
29 constexpr int E_OVER_LIMIT = E_BASE + 12;
30 constexpr int E_INVALID_CONFIG_VALUE = E_BASE + 13;
31 constexpr int E_NOT_FOUND = E_BASE + 14;
32 constexpr int E_COLLECTION_CONFLICT = E_BASE + 15;
33 constexpr int E_NO_DATA = E_BASE + 16;
34 constexpr int E_NOT_PERMIT = E_BASE + 17;
35 constexpr int E_DATA_CONFLICT = E_BASE + 18;
36 constexpr int E_INVALID_COLL_NAME_FORMAT = E_BASE + 19;
37 constexpr int E_INVALID_JSON_FORMAT = E_BASE + 40;
38 constexpr int E_JSON_PATH_NOT_EXISTS = E_BASE + 41;
39 constexpr int E_RESOURCE_BUSY = E_BASE + 50;
40 constexpr int E_FAILED_MEMORY_ALLOCATE = E_BASE + 51;
41 constexpr int E_INNER_ERROR = E_BASE + 52;
42 constexpr int E_INVALID_FILE_FORMAT = E_BASE + 53;
43 constexpr int E_FAILED_FILE_OPERATION = E_BASE + 54;
44 constexpr int E_NOT_SUPPORT = E_BASE + 55;
45 
46 int TransferDocErr(int err);
47 } // namespace DocumentDB
48 #endif // DOC_ERRNO_H