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 OHOS_DISTRIBUTED_DATA_INTERFACE_GDB_GDB_ERRORS_H 17 #define OHOS_DISTRIBUTED_DATA_INTERFACE_GDB_GDB_ERRORS_H 18 19 #include "errors.h" 20 21 namespace OHOS { 22 namespace DistributedDataAip { 23 enum { 24 AIP_MODULE_SERVICE_ID = 0x08, 25 }; 26 27 constexpr ErrCode DISTRIBUTEDDATAMGR_GDB_ERR_OFFSET = ErrCodeOffset(SUBSYS_DISTRIBUTEDDATAMNG, AIP_MODULE_SERVICE_ID); 28 29 /** 30 * @brief The error code in the correct case. 31 */ 32 constexpr int E_OK = 0; 33 34 /** 35 * @brief The base code of the exception error code. 36 */ 37 constexpr int E_BASE = DISTRIBUTEDDATAMGR_GDB_ERR_OFFSET; 38 39 /** 40 * @brief The error code for common exceptions. 41 */ 42 constexpr int E_ERROR = E_BASE; 43 44 constexpr int E_INVALID_ARGS = (E_BASE + 0x1); 45 constexpr int E_NOT_SUPPORT = (E_BASE + 0x2); 46 47 /* GRD error */ 48 49 constexpr int E_GRD_NO_DATA = (E_BASE + 0x3); 50 constexpr int E_GRD_DATA_CORRUPTED = (E_BASE + 0x4); 51 constexpr int E_GRD_DB_INSTANCE_ABNORMAL = (E_BASE + 0x5); 52 constexpr int E_DATABASE_BUSY = (E_BASE + 0x6); 53 constexpr int E_GRD_FAILED_MEMORY_ALLOCATE = (E_BASE + 0x7); 54 constexpr int E_GRD_DISK_SPACE_FULL = (E_BASE + 0x8); 55 constexpr int E_GRD_DUPLICATE_PARAM = (E_BASE + 0x9); 56 constexpr int E_GRD_UNDEFINED_PARAM = (E_BASE + 0xa); 57 constexpr int E_GRD_INVALID_NAME = (E_BASE + 0xb); 58 constexpr int E_GRD_SYNTAX_ERROR = (E_BASE + 0xc); 59 constexpr int E_GRD_SEMANTIC_ERROR = (E_BASE + 0xd); 60 constexpr int E_GRD_OVER_LIMIT = (E_BASE + 0xe); 61 62 constexpr int E_GRD_INVALID_ARGS = (E_BASE + 0xf); 63 constexpr int E_GRD_FAILED_FILE_OPERATION = (E_BASE + 0x10); 64 constexpr int E_GRD_CRC_CHECK_DISABLED = (E_BASE + 0x11); 65 constexpr int E_GRD_PERMISSION_DENIED = (E_BASE + 0x12); 66 constexpr int E_GRD_PASSWORD_UNMATCHED = (E_BASE + 0x13); 67 constexpr int E_GRD_PASSWORD_NEED_REKEY = (E_BASE + 0x14); 68 constexpr int E_GRD_WRONG_STMT_OBJECT = (E_BASE + 0x15); 69 constexpr int E_GRD_DATA_CONFLICT = (E_BASE + 0x16); 70 constexpr int E_GRD_INNER_ERR = (E_BASE + 0x17); 71 constexpr int E_GRD_FAILED_MEMORY_RELEASE = (E_BASE + 0x18); 72 constexpr int E_GRD_NOT_AVAILABLE = (E_BASE + 0x19); 73 constexpr int E_GRD_CIPHER_ERROR = (E_BASE + 0x1a); 74 constexpr int E_ARGS_READ_CON_OVERLOAD = (E_BASE + 0x1b); 75 constexpr int E_GRD_INVALID_FILE_FORMAT = (E_BASE + 0x1c); 76 constexpr int E_GRD_INVALID_BIND_VALUE = (E_BASE + 0x1d); 77 constexpr int E_GRD_DB_NOT_EXIST = (E_BASE + 0x1e); 78 constexpr int E_GRD_DATA_NOT_FOUND = (E_BASE + 0x1f); 79 constexpr int E_GRD_DATA_EXCEPTION = (E_BASE + 0x20); 80 constexpr int E_GRD_TRANSACTION_ROLLBACK = (E_BASE + 0x21); 81 constexpr int E_GRD_NO_ACTIVE_TRANSACTION = (E_BASE + 0x22); 82 constexpr int E_GRD_ACTIVE_TRANSACTION = (E_BASE + 0x23); 83 84 constexpr int E_ACQUIRE_CONN_FAILED = (E_BASE + 0x24); 85 constexpr int E_PREPARE_CHECK_FAILED = (E_BASE + 0x25); 86 constexpr int E_STEP_CHECK_FAILED = (E_BASE + 0x26); 87 constexpr int E_GETTED_COLNAME_EMPTY = (E_BASE + 0x27); 88 constexpr int E_PARSE_JSON_FAILED = (E_BASE + 0x28); 89 constexpr int E_INNER_ERROR = (E_BASE + 0x29); 90 constexpr int E_NO_DATA = (E_BASE + 0x2a); 91 constexpr int E_DBPATH_ACCESS_FAILED = (E_BASE + 0x2b); 92 constexpr int E_INIT_CONN_POOL_FAILED = (E_BASE + 0x2c); 93 constexpr int E_CONFIG_INVALID_CHANGE = (E_BASE + 0x2d); 94 constexpr int E_GRD_INVAILD_NAME_ERR = (E_BASE + 0x2e); 95 constexpr int E_CREATE_FOLDER_FAIT = (E_BASE + 0x3f); 96 constexpr int E_STATEMENT_EMPTY = (E_BASE + 0x30); 97 constexpr int E_STORE_HAS_CLOSED = (E_BASE + 0x31); 98 constexpr int E_GRD_NOT_SUPPORT = (E_BASE + 0x32); 99 } // namespace DistributedDataAip 100 } // namespace OHOS 101 102 #endif // OHOS_DISTRIBUTED_DATA_INTERFACE_GDB_GDB_ERRORS_H