1 /* 2 * Copyright (c) 2021-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 package com.ohos.hapsigntool.error; 17 18 /** 19 * Errors. 20 * 21 * @since 2021/12/28 22 */ 23 public enum ERROR { 24 /** 25 * success return code 26 */ 27 SUCCESS_CODE(0), 28 /** 29 * unknown error code 30 */ 31 UNKNOWN_ERROR(100), 32 /** 33 * Enum constant COMMAND_ERROR. 34 */ 35 COMMAND_ERROR(101), 36 /** 37 * Enum constant FILE_NOT_FOUND. 38 */ 39 FILE_NOT_FOUND(102), 40 /** 41 * Enum constant WRITE_FILE_ERROR. 42 */ 43 WRITE_FILE_ERROR(103), 44 /** 45 * Enum constant READ_FILE_ERROR. 46 */ 47 READ_FILE_ERROR(104), 48 /** 49 * Enum constant NOT_SUPPORT_ERROR. 50 */ 51 NOT_SUPPORT_ERROR(105), 52 /** 53 * Enum constant NETWORK_ERROR. 54 */ 55 NETWORK_ERROR(106), 56 /** 57 * Enum constant SIGN_ERROR. 58 */ 59 SIGN_ERROR(107), 60 /** 61 * Enum constant VERIFY_ERROR. 62 */ 63 VERIFY_ERROR(108), 64 /** 65 * Enum constant ACCESS_ERROR. 66 */ 67 ACCESS_ERROR(109), 68 /** 69 * Enum constant COMMAND_PARAM_ERROR. 70 */ 71 COMMAND_PARAM_ERROR(110), 72 /** 73 * Enum constant OPERATOR_CREATION_ERROR. 74 */ 75 OPERATOR_CREATION_ERROR(111), 76 /** 77 * Enum constant PARAM_NOT_EXIST_ERROR. 78 */ 79 PARAM_NOT_EXIST_ERROR(113), 80 /** 81 * Enum constant KEYSTORE_OPERATION_ERROR. 82 */ 83 KEYSTORE_OPERATION_ERROR(114), 84 /** 85 * Enum constant CERTIFICATE_ERROR. 86 */ 87 CERTIFICATE_ERROR(115), 88 /** 89 * Enum constant KEY_ERROR. 90 */ 91 KEY_ERROR(116), 92 /** 93 * Enum constant IO_CERT_ERROR. 94 */ 95 IO_CERT_ERROR(117), 96 /** 97 * Enum constant IO_CSR_ERROR. 98 */ 99 IO_CSR_ERROR(118), 100 101 /** 102 * Enum constant ZIP_ERROR. 103 */ 104 ZIP_ERROR(119); 105 106 /** 107 * Field errorCode. 108 */ 109 private final int errorCode; 110 111 /** 112 * getErrorCode. 113 * 114 * @return Integer code 115 */ getErrorCode()116 public int getErrorCode() { 117 return this.errorCode; 118 } 119 ERROR(int code)120 ERROR(int code) { 121 this.errorCode = code; 122 } 123 } 124