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 DUPDATE_ERRNO_H 17 #define DUPDATE_ERRNO_H 18 19 #include <limits.h> 20 #include <stdlib.h> 21 #include <stdint.h> 22 23 #ifdef __cplusplus 24 #if __cplusplus 25 extern "C" { 26 #endif 27 #endif 28 29 /** 30 * @brief Enumerates dupdate error number. 31 */ 32 typedef enum { 33 DUPDATE_NO_ERR = 0, 34 DUPDATE_ERR_INVALID_CODE = INT_MIN, 35 36 /* -519 ~ -500 reserved for softbus error numbers */ 37 DUPDATE_ERR_SOFTBUS_COMMON_ERROR = -500, 38 DUPDATE_ERR_SOFTBUS_FAIL = -501, 39 DUPDATE_ERR_SOFTBUS_PARAM_ERR = -502, 40 DUPDATE_ERR_SOFTBUS_APP_NOT_GRANTED = -503, 41 DUPDATE_ERR_SOFTBUS_DEV_UPG_INFO_ERR = -504, 42 DUPDATE_ERR_SOFTBUS_FORBIDDEN = -505, 43 DUPDATE_ERR_SOFTBUS_CONNECT_ERROR = -506, 44 DUPDATE_ERR_SOFTBUS_UN_SUPPORT = -507, 45 DUPDATE_ERR_SOFTBUS_TIME_OUT = -508, 46 47 /* -599 ~ -520 reserved for private softbus error numbers */ 48 49 /* -419 ~ -400 reserved for public update error numbers */ 50 DUPDATE_ERR_UPDATE_COMMON_ERROR = -400, 51 DUPDATE_ERR_OTA_PKG_NOT_EXIST = -401, 52 DUPDATE_ERR_OTA_WRITE_FAIL = -402, 53 DUPDATE_ERR_OTA_READ_FAIL = -403, 54 DUPDATE_ERR_DLOAD_NOT_OK = -405, 55 DUPDATE_ERR_UPDATE_FAIL = -406, 56 DUPDATE_ERR_SYSTEM_BUSY_ON_INSTALL = -407, 57 DUPDATE_ERR_INSTALL_NOT_OK = -408, 58 DUPDATE_ERR_UPDATE_PART_FAIL = -409, 59 DUPDATE_ERR_IPC_ERROR = -410, 60 DUPDATE_ERR_UPDATE_NO_EXECUTED = -411, 61 DUPDATE_ERR_UPDATE_FILE_ERROR = -412, 62 63 /* -499 ~ -420 reserved for private update error numbers */ 64 DUPDATE_ERR_UPDATE_PRECHECK_FAIL = -420, 65 DUPDATE_ERR_UPDATE_REBOOT_FAIL = -421, 66 67 /* -319 ~ -300 reserved for public dload error numbers */ 68 DUPDATE_ERR_DOWNLOAD_COMMON_ERROR = -300, 69 DUPDATE_ERR_DLOAD_REQUEST_FAIL = -301, 70 DUPDATE_ERR_GET_PKG_SIZE = -302, 71 DUPDATE_ERR_NO_NEW_VERSION = -303, 72 DUPDATE_ERR_NO_ENOUGH_MEMORY = -304, 73 DUPDATE_ERR_VERIFY_PACKAGE_FAIL = -305, 74 DUPDATE_ERR_DOWNLOAD_PACKAGE_FAIL = -306, 75 DUPDATE_ERR_SYSTEM_BUSY_ON_DOWNLOAD = -307, 76 77 /* -399 ~ -320 reserved for private dload error numbers */ 78 DUPDATE_ERR_INIT_DOWNLOAD_PARAM_FAIL = -320, 79 80 /* -219 ~ -200 reserved for public search error numbers */ 81 DUPDATE_ERR_CHECK_COMMON_ERROR = -200, 82 DUPDATE_ERR_CREATE_REQUEST_PARAMS_ERROR = -201, 83 DUPDATE_ERR_REQUEST_SERVER_ERROR = -202, 84 DUPDATE_ERR_ANALYZE_VERSION_ERROR = -203, 85 DUPDATE_ERR_PARSE_FILELIST_ERROR = -204, 86 DUPDATE_ERR_PARSE_CHANGELOG_ERROR = -205, 87 DUPDATE_ERR_SERVER_IS_BUSY = -206, 88 DUPDATE_ERR_SYSTEM_BUSY_ON_CHECK = -207, 89 DUPDATE_ERR_SECURITY_AUTH_FAIL = -208, 90 DUPDATE_ERR_SECURITY_AUTH_SERVER_ERROR = -209, 91 DUPDATE_ERR_SECURITY_AUTH_SYSTEM_ERROR = -210, 92 93 /* -299 ~ -220 reserved for private search error numbers */ 94 95 /* -119 ~ -100 reserved for public common error numbers */ 96 DUPDATE_ERR_INTERNAL_ERROR = -100, 97 DUPDATE_ERR_TIME_OUT = -101, 98 DUPDATE_ERR_GET_DEV_INFO_ERROR = -102, 99 DUPDATE_ERR_FILE_OPERATE_ERROR = -103, 100 DUPDATE_ERR_NO_INTERNET = -104, 101 DUPDATE_ERR_EXCEED_MAX_USER_NUM = -105, 102 DUPDATE_ERR_INPUT_PARA_ERROR = -106, 103 DUPDATE_ERR_INVALID_POLICY_PARA = -107, 104 105 /* -199 ~ -120 reserved for private common error numbers */ 106 DUPDATE_ERR_CHECK_PERM_FAIL = -120, 107 DUPDATE_ERR_CONNECT_SERVER_FAIL = -121, 108 DUPDATE_ERR_THREAD_CREATE_FAIL = -123, 109 110 DUPDATE_ERR_BUTT = -99, 111 112 DUPDATE_ERR_LOW_BATTERY_LEVEL = -830, 113 } DUpdateErrno; 114 #ifdef __cplusplus 115 } 116 #endif 117 #endif // DUPDATE_ERRNO_H