github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/errors/status/error.go (about) 1 package status 2 3 import "net/http" 4 5 //go:generate toolkit gen status Error 6 type Error int 7 8 func (Error) ServiceCode() int { 9 return 999 * 1e3 10 } 11 12 const ( 13 // internal error 14 InternalServerError Error = http.StatusInternalServerError*1e6 + iota + 1 15 // @errTalk Database Error 16 DatabaseError 17 // @errTalk Upload File Failed 18 UploadFileFailed 19 // @errTalk Fetch Resource Failed 20 FetchResourceFailed 21 // @errTalk Config Init Failed 22 ConfigInitFailed 23 // @errTalk Config Uninit Failed 24 ConfigUninitFailed 25 // @errTalk Config Parse Failed 26 ConfigParseFailed 27 // @errTalk Create Instance Failed 28 CreateInstanceFailed 29 // @errTalk Batch Remove Applet Failed 30 BatchRemoveAppletFailed 31 // @errTalk MQTT Subscribe Failed 32 MqttSubscribeFailed 33 // @errTalk MQTT Connect Failed 34 MqttConnectFailed 35 // @errTalk Batch Remove WasmLog Failed 36 BatchRemoveWasmLogFailed 37 // @errTalk Gen Token Failed 38 GenTokenFailed 39 // @errTalk Create Traffic Scheduler Failed 40 CreateTrafficSchedulerFailed 41 // @errTalk Update Traffic Scheduler Failed 42 UpdateTrafficSchedulerFailed 43 ) 44 45 const ( 46 // unauthorized 47 Unauthorized Error = http.StatusUnauthorized*1e6 + iota + 1 48 // @errTalk Invalid Auth Value 49 InvalidAuthValue 50 // @errTalk Invalid Auth Account ID 51 InvalidAuthAccountID 52 // @errTalk No Project Permission 53 NoProjectPermission 54 // @errTalk No Operator Permission 55 NoOperatorPermission 56 // @errTalk No Admin Permission 57 NoAdminPermission 58 // @errTalk Invalid Old Password 59 InvalidOldPassword 60 // @errTalk Invalid New Password 61 InvalidNewPassword 62 // @errTalk Invalid Password 63 InvalidPassword 64 // @errTalk Invalid Siwe Signature 65 InvalidEthLoginSignature 66 // @errTalk Invalid Siwe Message 67 InvalidEthLoginMessage 68 // @errTalk Invalid Auth Publisher ID 69 InvalidAuthPublisherID 70 // @errTalk Current Account Absence 71 CurrentAccountAbsence 72 // @errTalk Invalid Event Channel 73 InvalidEventChannel 74 // @errTalk Invalid Event Token 75 InvalidEventToken 76 // @errTalk Invalid Applet 77 InvalidAppletContext 78 // @errTalk No Resource Permission 79 NoResourcePermission 80 // @errTalk Invalid Account Access Key 81 InvalidAccessKey 82 // @errTalk invalid data push should account 83 InvalidDataPushShouldAccount 84 // @errTalk invalid data push should publisher 85 InvalidDataPushShouldPublisher 86 ) 87 88 const ( 89 // forbidden 90 Forbidden Error = http.StatusForbidden*1e6 + iota + 1 91 // @errTalk Disabled Account 92 DisabledAccount 93 // @errTalk White List Forbidden 94 WhiteListForbidden 95 // @errTalk Upload File Size Limit 96 UploadFileSizeLimit 97 // @errTalk Upload File Md5 Unmatched 98 UploadFileMd5Unmatched 99 // @errTalk Upload File Disk Limit 100 UploadFileDiskLimit 101 // @errTalk Topic Already Subscribed 102 TopicAlreadySubscribed 103 // @errTalk Occupied Operator 104 OccupiedOperator 105 // @errTalk Unsupported FileSystem Operator 106 UnsupportedFSOperator 107 // @errTalk Account Access Key Expired 108 AccessKeyExpired 109 // @errTalk Access Key Permission Denied 110 AccessKeyPermissionDenied 111 ) 112 113 const ( 114 // @errTalk TooManyRequest too many request 115 TooManyRequest Error = http.StatusTooManyRequests*1e6 + iota + 1 116 // @errTalk Traffic Limit Exceeded Failed 117 TrafficLimitExceededFailed 118 ) 119 120 const ( 121 // @errTalk Conflict conflict error 122 Conflict Error = http.StatusConflict*1e6 + iota + 1 123 // @errTalk Project Name Conflict 124 ProjectNameConflict 125 // @errTalk Resource Conflict 126 ResourceConflict 127 // @errTalk Resource Owner Conflict 128 ResourceOwnerConflict 129 // @errTalk Strategy Conflict 130 StrategyConflict 131 // @errTalk Config Conflict 132 ConfigConflict 133 // @errTalk Publisher Conflict 134 PublisherConflict 135 // @errTalk Multi Instance Deployed 136 MultiInstanceDeployed 137 // @errTalk Applet Name Conflict 138 AppletNameConflict 139 // @errTalk Cron Job Conflict 140 CronJobConflict 141 // @errTalk Contract Log Conflict 142 ContractLogConflict 143 // @errTalk Chain Tx Conflict 144 ChainTxConflict 145 // @errTalk Chain Height Conflict 146 ChainHeightConflict 147 // @errTalk Account Identity Conflict 148 AccountIdentityConflict 149 // @errTalk Account Conflict 150 AccountConflict 151 // @errTalk Account Password Conflict 152 AccountPasswordConflict 153 // @errTalk Operator Conflict 154 OperatorConflict 155 // @errTalk Traffic Limit Conflict 156 TrafficLimitConflict 157 // @errTalk Project Operator relationship Conflict 158 ProjectOperatorConflict 159 // @errTalk Access Key Name Conflict 160 AccessKeyNameConflict 161 ) 162 163 const ( 164 // @errTalk BadRequest 165 BadRequest Error = http.StatusBadRequest*1e6 + iota + 1 166 // @errTalk Invalid Config Type 167 InvalidConfigType 168 // @errTalk Deprecated Project 169 DeprecatedProject 170 // @errTalk Unknown Deploy Command 171 UnknownDeployCommand 172 // @errTalk Invalid Cron Expressions 173 InvalidCronExpressions 174 // @errTalk Invalid Private Key 175 InvalidPrivateKey 176 // @errTalk Invalid Delete Condition 177 InvalidDeleteCondition 178 // @errTalk Unknown Deploy Command 179 UnknownMonitorCommand 180 // @errTalk Invalid Contract Log IDs 181 InvalidContractLogIDs 182 // @errTalk Invalid Chain Tx IDs 183 InvalidChainTxIDs 184 // @errTalk Invalid Chain Height IDs 185 InvalidChainHeightIDs 186 // @errTalk Invalid VM State 187 InvalidVMState 188 // @errTalk Invalid Access Key Identity Type 189 InvalidAccessKeyIdentityType 190 ) 191 192 const ( 193 // @errTalk NotFound 194 NotFound Error = http.StatusNotFound*1e6 + iota + 1 195 // @errTalk Project Not Found 196 ProjectNotFound 197 // @errTalk Config Not Found 198 ConfigNotFound 199 // @errTalk Resource Not Found 200 ResourceNotFound 201 // @errTalk Applet Not Found 202 AppletNotFound 203 // @errTalk Instance Not Found 204 InstanceNotFound 205 // @errTalk Strategy Not Found 206 StrategyNotFound 207 // @errTalk Publisher Not Found 208 PublisherNotFound 209 // @errTalk Account Identity Not Found 210 AccountIdentityNotFound 211 // @errTalk Resource Perm Not Found 212 ResourcePermNotFound 213 // @errTalk Cron Job Not Found 214 CronJobNotFound 215 // @errTalk Instance Not Running 216 InstanceNotRunning 217 // @errTalk Blockchain Not Found 218 BlockchainNotFound 219 // @errTalk Contract Log Not Found 220 ContractLogNotFound 221 // @errTalk Chain Tx Not Found 222 ChainTxNotFound 223 // @errTalk Chain Height Not Found 224 ChainHeightNotFound 225 // @errTalk Account Not Found 226 AccountNotFound 227 // @errTalk Account Password Not Found 228 AccountPasswordNotFound 229 // @errTalk Operator Not Found 230 OperatorNotFound 231 // @errTalk Traffic Limit Not Found 232 TrafficLimitNotFound 233 // @errTalk Project Operator relationship Not Found 234 ProjectOperatorNotFound 235 // @errTalk Account Key Not Found 236 AccessKeyNotFound 237 // @errTalk invalid data push payload 238 InvalidDataPushPayload 239 )