github.com/polarismesh/polaris@v1.17.8/common/api/v1/codeinfo.go (about) 1 /** 2 * Tencent is pleased to support the open source community by making Polaris available. 3 * 4 * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 5 * 6 * Licensed under the BSD 3-Clause License (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * https://opensource.org/licenses/BSD-3-Clause 11 * 12 * Unless required by applicable law or agreed to in writing, software distributed 13 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 14 * CONDITIONS OF ANY KIND, either express or implied. See the License for the 15 * specific language governing permissions and limitations under the License. 16 */ 17 18 package v1 19 20 import apimodel "github.com/polarismesh/specification/source/go/api/v1/model" 21 22 // 北极星错误码 23 // 六位构成,前面三位参照HTTP Status的标准 24 // 后面三位,依据内部的具体错误自定义 25 const ( 26 ExecuteSuccess = uint32(apimodel.Code_ExecuteSuccess) 27 DataNoChange = uint32(apimodel.Code_DataNoChange) 28 NoNeedUpdate = uint32(apimodel.Code_NoNeedUpdate) 29 BadRequest = uint32(apimodel.Code_BadRequest) 30 ParseException = uint32(apimodel.Code_ParseException) 31 EmptyRequest = uint32(apimodel.Code_EmptyRequest) 32 BatchSizeOverLimit = uint32(apimodel.Code_BatchSizeOverLimit) 33 InvalidDiscoverResource = uint32(apimodel.Code_InvalidDiscoverResource) 34 InvalidRequestID = uint32(apimodel.Code_InvalidRequestID) 35 InvalidUserName = uint32(apimodel.Code_InvalidUserName) 36 InvalidUserToken = uint32(apimodel.Code_InvalidUserToken) 37 InvalidParameter = uint32(apimodel.Code_InvalidParameter) 38 EmptyQueryParameter = uint32(apimodel.Code_EmptyQueryParameter) 39 InvalidQueryInsParameter = uint32(apimodel.Code_InvalidQueryInsParameter) 40 InvalidNamespaceName = uint32(apimodel.Code_InvalidNamespaceName) 41 InvalidNamespaceOwners = uint32(apimodel.Code_InvalidNamespaceOwners) 42 InvalidNamespaceToken = uint32(apimodel.Code_InvalidNamespaceToken) 43 InvalidServiceName = uint32(apimodel.Code_InvalidServiceName) 44 InvalidServiceOwners = uint32(apimodel.Code_InvalidServiceOwners) 45 InvalidServiceToken = uint32(apimodel.Code_InvalidServiceToken) 46 InvalidServiceMetadata = uint32(apimodel.Code_InvalidServiceMetadata) 47 InvalidServicePorts = uint32(apimodel.Code_InvalidServicePorts) 48 InvalidServiceBusiness = uint32(apimodel.Code_InvalidServiceBusiness) 49 InvalidServiceDepartment = uint32(apimodel.Code_InvalidServiceDepartment) 50 InvalidServiceCMDB = uint32(apimodel.Code_InvalidServiceCMDB) 51 InvalidServiceComment = uint32(apimodel.Code_InvalidServiceComment) 52 InvalidServiceAliasComment = uint32(apimodel.Code_InvalidServiceAliasComment) 53 InvalidInstanceID = uint32(apimodel.Code_InvalidInstanceID) 54 InvalidInstanceHost = uint32(apimodel.Code_InvalidInstanceHost) 55 InvalidInstancePort = uint32(apimodel.Code_InvalidInstancePort) 56 InvalidServiceAlias = uint32(apimodel.Code_InvalidServiceAlias) 57 InvalidNamespaceWithAlias = uint32(apimodel.Code_InvalidNamespaceWithAlias) 58 InvalidServiceAliasOwners = uint32(apimodel.Code_InvalidServiceAliasOwners) 59 InvalidInstanceProtocol = uint32(apimodel.Code_InvalidInstanceProtocol) 60 InvalidInstanceVersion = uint32(apimodel.Code_InvalidInstanceVersion) 61 InvalidInstanceLogicSet = uint32(apimodel.Code_InvalidInstanceLogicSet) 62 InvalidInstanceIsolate = uint32(apimodel.Code_InvalidInstanceIsolate) 63 HealthCheckNotOpen = uint32(apimodel.Code_HealthCheckNotOpen) 64 HeartbeatOnDisabledIns = uint32(apimodel.Code_HeartbeatOnDisabledIns) 65 HeartbeatExceedLimit = uint32(apimodel.Code_HeartbeatExceedLimit) 66 HeartbeatTypeNotFound = uint32(apimodel.Code_HeartbeatTypeNotFound) 67 InvalidMetadata = uint32(apimodel.Code_InvalidMetadata) 68 InvalidRateLimitID = uint32(apimodel.Code_InvalidRateLimitID) 69 InvalidRateLimitLabels = uint32(apimodel.Code_InvalidRateLimitLabels) 70 InvalidRateLimitAmounts = uint32(apimodel.Code_InvalidRateLimitAmounts) 71 InvalidRateLimitName = uint32(apimodel.Code_InvalidRateLimitName) 72 InvalidCircuitBreakerID = uint32(apimodel.Code_InvalidCircuitBreakerID) 73 InvalidCircuitBreakerVersion = uint32(apimodel.Code_InvalidCircuitBreakerVersion) 74 InvalidCircuitBreakerName = uint32(apimodel.Code_InvalidCircuitBreakerName) 75 InvalidCircuitBreakerNamespace = uint32(apimodel.Code_InvalidCircuitBreakerNamespace) 76 InvalidCircuitBreakerOwners = uint32(apimodel.Code_InvalidCircuitBreakerOwners) 77 InvalidCircuitBreakerToken = uint32(apimodel.Code_InvalidCircuitBreakerToken) 78 InvalidCircuitBreakerBusiness = uint32(apimodel.Code_InvalidCircuitBreakerBusiness) 79 InvalidCircuitBreakerDepartment = uint32(apimodel.Code_InvalidCircuitBreakerDepartment) 80 InvalidCircuitBreakerComment = uint32(apimodel.Code_InvalidCircuitBreakerComment) 81 InvalidRoutingID = uint32(apimodel.Code_InvalidRoutingID) 82 InvalidRoutingPolicy = uint32(apimodel.Code_InvalidRoutingPolicy) 83 InvalidRoutingName = uint32(apimodel.Code_InvalidRoutingName) 84 InvalidRoutingPriority = uint32(apimodel.Code_InvalidRoutingPriority) 85 86 // 网格相关错误码 87 ServicesExistedMesh = uint32(apimodel.Code_ServicesExistedMesh) 88 ResourcesExistedMesh = uint32(apimodel.Code_ResourcesExistedMesh) 89 InvalidMeshParameter = uint32(apimodel.Code_InvalidMeshParameter) 90 91 // 平台信息相关错误码 92 InvalidPlatformID = uint32(apimodel.Code_InvalidPlatformID) 93 InvalidPlatformName = uint32(apimodel.Code_InvalidPlatformName) 94 InvalidPlatformDomain = uint32(apimodel.Code_InvalidPlatformDomain) 95 InvalidPlatformQPS = uint32(apimodel.Code_InvalidPlatformQPS) 96 InvalidPlatformToken = uint32(apimodel.Code_InvalidPlatformToken) 97 InvalidPlatformOwner = uint32(apimodel.Code_InvalidPlatformOwner) 98 InvalidPlatformDepartment = uint32(apimodel.Code_InvalidPlatformDepartment) 99 InvalidPlatformComment = uint32(apimodel.Code_InvalidPlatformComment) 100 NotFoundPlatform = uint32(apimodel.Code_NotFoundPlatform) 101 102 // flux相关错误码 103 InvalidFluxRateLimitId = uint32(apimodel.Code_InvalidFluxRateLimitId) 104 InvalidFluxRateLimitQps = uint32(apimodel.Code_InvalidFluxRateLimitQps) 105 InvalidFluxRateLimitSetKey = uint32(apimodel.Code_InvalidFluxRateLimitSetKey) 106 107 ExistedResource = uint32(apimodel.Code_ExistedResource) 108 NotFoundResource = uint32(apimodel.Code_NotFoundResource) 109 NamespaceExistedServices = uint32(apimodel.Code_NamespaceExistedServices) 110 ServiceExistedInstances = uint32(apimodel.Code_ServiceExistedInstances) 111 ServiceExistedRoutings = uint32(apimodel.Code_ServiceExistedRoutings) 112 ServiceExistedRateLimits = uint32(apimodel.Code_ServiceExistedRateLimits) 113 ExistReleasedConfig = uint32(apimodel.Code_ExistReleasedConfig) 114 SameInstanceRequest = uint32(apimodel.Code_SameInstanceRequest) 115 ServiceExistedCircuitBreakers = uint32(apimodel.Code_ServiceExistedCircuitBreakers) 116 ServiceExistedAlias = uint32(apimodel.Code_ServiceExistedAlias) 117 NamespaceExistedMeshResources = uint32(apimodel.Code_NamespaceExistedMeshResources) 118 NamespaceExistedCircuitBreakers = uint32(apimodel.Code_NamespaceExistedCircuitBreakers) 119 ServiceSubscribedByMeshes = uint32(apimodel.Code_ServiceSubscribedByMeshes) 120 ServiceExistedFluxRateLimits = uint32(apimodel.Code_ServiceExistedFluxRateLimits) 121 NamespaceExistedConfigGroups = uint32(apimodel.Code_NamespaceExistedConfigGroups) 122 123 NotFoundService = uint32(apimodel.Code_NotFoundService) 124 NotFoundRouting = uint32(apimodel.Code_NotFoundRouting) 125 NotFoundInstance = uint32(apimodel.Code_NotFoundInstance) 126 NotFoundServiceAlias = uint32(apimodel.Code_NotFoundServiceAlias) 127 NotFoundNamespace = uint32(apimodel.Code_NotFoundNamespace) 128 NotFoundSourceService = uint32(apimodel.Code_NotFoundSourceService) 129 NotFoundRateLimit = uint32(apimodel.Code_NotFoundRateLimit) 130 NotFoundCircuitBreaker = uint32(apimodel.Code_NotFoundCircuitBreaker) 131 NotFoundMasterConfig = uint32(apimodel.Code_NotFoundMasterConfig) 132 NotFoundTagConfig = uint32(apimodel.Code_NotFoundTagConfig) 133 NotFoundTagConfigOrService = uint32(apimodel.Code_NotFoundTagConfigOrService) 134 ClientAPINotOpen = uint32(apimodel.Code_ClientAPINotOpen) 135 NotAllowBusinessService = uint32(apimodel.Code_NotAllowBusinessService) 136 NotAllowAliasUpdate = uint32(apimodel.Code_NotAllowAliasUpdate) 137 NotAllowAliasCreateInstance = uint32(apimodel.Code_NotAllowAliasCreateInstance) 138 NotAllowAliasCreateRouting = uint32(apimodel.Code_NotAllowAliasCreateRouting) 139 NotAllowCreateAliasForAlias = uint32(apimodel.Code_NotAllowCreateAliasForAlias) 140 NotAllowAliasCreateRateLimit = uint32(apimodel.Code_NotAllowAliasCreateRateLimit) 141 NotAllowAliasBindRule = uint32(apimodel.Code_NotAllowAliasBindRule) 142 NotAllowDifferentNamespaceBindRule = uint32(apimodel.Code_NotAllowDifferentNamespaceBindRule) 143 Unauthorized = uint32(apimodel.Code_Unauthorized) 144 NotAllowedAccess = uint32(apimodel.Code_NotAllowedAccess) 145 IPRateLimit = uint32(apimodel.Code_IPRateLimit) 146 APIRateLimit = uint32(apimodel.Code_APIRateLimit) 147 CMDBNotFindHost = uint32(apimodel.Code_CMDBNotFindHost) 148 DataConflict = uint32(apimodel.Code_DataConflict) 149 InstanceTooManyRequests = uint32(apimodel.Code_InstanceTooManyRequests) 150 ExecuteException = uint32(apimodel.Code_ExecuteException) 151 StoreLayerException = uint32(apimodel.Code_StoreLayerException) 152 CMDBPluginException = uint32(apimodel.Code_CMDBPluginException) 153 ParseRoutingException = uint32(apimodel.Code_ParseRoutingException) 154 ParseRateLimitException = uint32(apimodel.Code_ParseRateLimitException) 155 ParseCircuitBreakerException = uint32(apimodel.Code_ParseCircuitBreakerException) 156 HeartbeatException = uint32(apimodel.Code_HeartbeatException) 157 InstanceRegisTimeout = uint32(apimodel.Code_InstanceRegisTimeout) 158 159 // 配置中心模块的错误码 160 161 InvalidConfigFileGroupName = uint32(apimodel.Code_InvalidConfigFileGroupName) 162 InvalidConfigFileName = uint32(apimodel.Code_InvalidConfigFileName) 163 InvalidConfigFileContentLength = uint32(apimodel.Code_InvalidConfigFileContentLength) 164 InvalidConfigFileFormat = uint32(apimodel.Code_InvalidConfigFileFormat) 165 InvalidConfigFileTags = uint32(apimodel.Code_InvalidConfigFileTags) 166 InvalidWatchConfigFileFormat = uint32(apimodel.Code_InvalidWatchConfigFileFormat) 167 NotFoundResourceConfigFile = uint32(apimodel.Code_NotFoundResourceConfigFile) 168 InvalidConfigFileTemplateName = uint32(apimodel.Code_InvalidConfigFileTemplateName) 169 170 // 鉴权相关错误码 171 InvalidUserOwners = uint32(apimodel.Code_InvalidUserOwners) 172 InvalidUserID = uint32(apimodel.Code_InvalidUserID) 173 InvalidUserPassword = uint32(apimodel.Code_InvalidUserPassword) 174 InvalidUserMobile = uint32(apimodel.Code_InvalidUserMobile) 175 InvalidUserEmail = uint32(apimodel.Code_InvalidUserEmail) 176 InvalidUserGroupOwners = uint32(apimodel.Code_InvalidUserGroupOwners) 177 InvalidUserGroupID = uint32(apimodel.Code_InvalidUserGroupID) 178 InvalidAuthStrategyOwners = uint32(apimodel.Code_InvalidAuthStrategyOwners) 179 InvalidAuthStrategyName = uint32(apimodel.Code_InvalidAuthStrategyName) 180 InvalidAuthStrategyID = uint32(apimodel.Code_InvalidAuthStrategyID) 181 InvalidPrincipalType = uint32(apimodel.Code_InvalidPrincipalType) 182 183 UserExisted = uint32(apimodel.Code_UserExisted) 184 UserGroupExisted = uint32(apimodel.Code_UserGroupExisted) 185 AuthStrategyRuleExisted = uint32(apimodel.Code_AuthStrategyRuleExisted) 186 SubAccountExisted = uint32(apimodel.Code_SubAccountExisted) 187 NotFoundUser = uint32(apimodel.Code_NotFoundUser) 188 NotFoundOwnerUser = uint32(apimodel.Code_NotFoundOwnerUser) 189 NotFoundUserGroup = uint32(apimodel.Code_NotFoundUserGroup) 190 NotFoundAuthStrategyRule = uint32(apimodel.Code_NotFoundAuthStrategyRule) 191 NotAllowModifyDefaultStrategyPrincipal = uint32(apimodel.Code_NotAllowModifyDefaultStrategyPrincipal) 192 NotAllowModifyOwnerDefaultStrategy = uint32(apimodel.Code_NotAllowModifyOwnerDefaultStrategy) 193 194 EmptyAutToken = uint32(apimodel.Code_EmptyAutToken) 195 TokenDisabled = uint32(apimodel.Code_TokenDisabled) 196 TokenNotExisted = uint32(apimodel.Code_TokenNotExisted) 197 198 AuthTokenVerifyException = uint32(apimodel.Code_AuthTokenForbidden) 199 OperationRoleException = uint32(apimodel.Code_OperationRoleForbidden) 200 ) 201 202 // code to string 203 // code的字符串描述信息 204 var code2info = map[uint32]string{ 205 ExecuteSuccess: "execute success", 206 DataNoChange: "discover data is no change", 207 NoNeedUpdate: "update data is no change, no need to update", 208 BadRequest: "bad request", 209 ParseException: "request decode failed", 210 EmptyRequest: "empty request", 211 BatchSizeOverLimit: "batch size over the limit", 212 InvalidDiscoverResource: "invalid discover resource", 213 InvalidRequestID: "invalid request id", 214 InvalidUserName: "invalid user name", 215 InvalidUserToken: "invalid user token", 216 InvalidParameter: "invalid parameter", 217 EmptyQueryParameter: "query instance parameter is empty", 218 InvalidQueryInsParameter: "query instance, service or namespace or host is required", 219 InvalidNamespaceName: "invalid namespace name", 220 InvalidNamespaceOwners: "invalid namespace owners", 221 InvalidNamespaceToken: "invalid namespace token", 222 InvalidServiceName: "invalid service name", 223 InvalidServiceOwners: "invalid service owners", 224 InvalidServiceToken: "invalid service token", 225 InvalidServiceMetadata: "invalid service metadata", 226 InvalidServicePorts: "invalid service ports", 227 InvalidServiceBusiness: "invalid service business", 228 InvalidServiceDepartment: "invalid service department", 229 InvalidServiceCMDB: "invalid service CMDB", 230 InvalidServiceComment: "invalid service comment", 231 InvalidServiceAliasComment: "invalid service alias comment", 232 InvalidInstanceID: "invalid instance id", 233 InvalidInstanceHost: "invalid instance host", 234 InvalidInstancePort: "invalid instance port", 235 InvalidInstanceProtocol: "invalid instance protocol", 236 InvalidInstanceVersion: "invalid instance version", 237 InvalidInstanceLogicSet: "invalid instance logic set", 238 InvalidInstanceIsolate: "invalid instance isolate", 239 InvalidServiceAlias: "invalid service alias", 240 InvalidNamespaceWithAlias: "request namespace is not allow to create sid type alias", 241 InvalidServiceAliasOwners: "invalid service alias owners", 242 HealthCheckNotOpen: "server not open health check", 243 HeartbeatOnDisabledIns: "heartbeat on disabled instance", 244 HeartbeatExceedLimit: "instance can only heartbeat 1 time per second", 245 InvalidMetadata: "the length of metadata is too long or metadata contains invalid characters", 246 InvalidRateLimitID: "invalid rate limit id", 247 InvalidRateLimitLabels: "invalid rate limit labels", 248 InvalidRateLimitAmounts: "invalid rate limit amounts", 249 InvalidCircuitBreakerID: "invalid circuit breaker id", 250 InvalidCircuitBreakerVersion: "invalid circuit breaker version", 251 InvalidCircuitBreakerName: "invalid circuit breaker name", 252 InvalidCircuitBreakerNamespace: "invalid circuit breaker namespace", 253 InvalidCircuitBreakerOwners: "invalid circuit breaker owners", 254 InvalidCircuitBreakerToken: "invalid circuit breaker token", 255 InvalidCircuitBreakerBusiness: "invalid circuit breaker business", 256 InvalidCircuitBreakerDepartment: "invalid circuit breaker department", 257 InvalidCircuitBreakerComment: "invalid circuit breaker comment", 258 ExistedResource: "existed resource", 259 SameInstanceRequest: "the same instance request", 260 NotFoundResource: "not found resource", 261 ClientAPINotOpen: "client api is not open", 262 NotAllowBusinessService: "not allow requesting business service", 263 NotAllowAliasUpdate: "not allow service alias updating", 264 NotAllowAliasCreateInstance: "not allow service alias creating instance", 265 NotAllowAliasCreateRouting: "not allow service alias creating routing config", 266 NotAllowCreateAliasForAlias: "only source service can create alias", 267 NotAllowAliasCreateRateLimit: "not allow service alias creating rate limit", 268 NotAllowAliasBindRule: "not allow service alias binding rule", 269 NotAllowDifferentNamespaceBindRule: "not allow different namespace binding rule", 270 NamespaceExistedServices: "some services existed in namespace", 271 ServiceExistedInstances: "some instances existed in service", 272 ServiceExistedRoutings: "some routings existed in service", 273 ServiceExistedRateLimits: "some rate limits existed in service", 274 ServiceExistedCircuitBreakers: "some circuit breakers existed in service", 275 ServiceExistedAlias: "some aliases existed in service", 276 NamespaceExistedMeshResources: "some mesh resources existed in namespace", 277 NamespaceExistedCircuitBreakers: "some circuit breakers existed in namespace", 278 ExistReleasedConfig: "exist released config", 279 NotFoundService: "not found service", 280 NotFoundRouting: "not found routing", 281 NotFoundInstance: "not found instances", 282 NotFoundServiceAlias: "not found service alias", 283 NotFoundNamespace: "not found namespace", 284 NotFoundSourceService: "not found the source service link with the alias", 285 NotFoundRateLimit: "not found rate limit", 286 NotFoundCircuitBreaker: "not found circuit breaker", 287 NotFoundTagConfig: "not found tag config", 288 NotFoundMasterConfig: "not found master config", 289 NotFoundTagConfigOrService: "not found tag config or service, or relation already exists", 290 Unauthorized: "unauthorized", 291 NotAllowedAccess: "access is not approved", 292 IPRateLimit: "server limit the ip access", 293 APIRateLimit: "server limit the api access", 294 CMDBNotFindHost: "not found the host cmdb", 295 DataConflict: "data is conflict, please try again", 296 InstanceTooManyRequests: "your instance has too many requests", 297 ExecuteException: "execute exception", 298 StoreLayerException: "store layer exception", 299 CMDBPluginException: "cmdb plugin exception", 300 ParseRoutingException: "parsing routing failed", 301 ParseRateLimitException: "parse rate limit failed", 302 ParseCircuitBreakerException: "parse circuit breaker failed", 303 HeartbeatException: "heartbeat execute exception", 304 InvalidPlatformID: "invalid platform id", 305 InvalidPlatformName: "invalid platform name", 306 InvalidPlatformDomain: "invalid platform domain", 307 InvalidPlatformQPS: "invalid platform qps", 308 InvalidPlatformToken: "invalid platform token", 309 InvalidPlatformOwner: "invalid platform owner", 310 InvalidPlatformDepartment: "invalid platform department", 311 InvalidPlatformComment: "invalid platform comment", 312 NotFoundPlatform: "not found platform", 313 ServicesExistedMesh: "services existed mesh", 314 ResourcesExistedMesh: "resources existed mesh", 315 ServiceSubscribedByMeshes: "service subscribed by some mesh", 316 InvalidMeshParameter: "invalid mesh parameter", 317 InvalidFluxRateLimitId: "invalid flux ratelimit id", 318 InvalidFluxRateLimitQps: "invalid flux ratelimit qps", 319 InvalidFluxRateLimitSetKey: "invalid flux ratelimit key", 320 InstanceRegisTimeout: "instance async regist timeout", 321 322 // 配置中心的错误信息 323 InvalidConfigFileGroupName: "invalid config file group name", 324 InvalidConfigFileName: "invalid config file name", 325 InvalidConfigFileContentLength: "config file content too long", 326 InvalidConfigFileFormat: "invalid config file format, support json,xml,html,properties,text,yaml", 327 InvalidConfigFileTags: "invalid config file tags, tags should be pair, like key1,value1,key2,value2, " + 328 "both key and value should not blank", 329 InvalidWatchConfigFileFormat: "invalid watch config file format", 330 NotFoundResourceConfigFile: "config file not existed", 331 InvalidConfigFileTemplateName: "invalid config file template name", 332 333 // 鉴权错误 334 NotFoundUser: "not found user", 335 NotFoundOwnerUser: "not found owner user", 336 NotFoundUserGroup: "not found usergroup", 337 NotFoundAuthStrategyRule: "not found auth strategy rule", 338 339 UserExisted: "exist user", 340 UserGroupExisted: "exist usergroup", 341 AuthStrategyRuleExisted: "exist auth strategy rule", 342 InvalidUserGroupOwners: "invalid usergroup owner attribute", 343 InvalidAuthStrategyName: "invalid auth strategy rule name", 344 InvalidAuthStrategyOwners: "invalid auth strategy rule owner", 345 InvalidUserPassword: "invalid user password", 346 InvalidPrincipalType: "invalid principal type", 347 TokenDisabled: "token already disabled", 348 AuthTokenVerifyException: "token verify exception", 349 OperationRoleException: "operation role exception", 350 EmptyAutToken: "auth token empty", 351 SubAccountExisted: "some sub-account existed in owner", 352 InvalidUserID: "invalid user-id", 353 TokenNotExisted: "token not existed", 354 355 NotAllowModifyDefaultStrategyPrincipal: "not allow modify default strategy principal", 356 NotAllowModifyOwnerDefaultStrategy: "not allow modify main account default strategy", 357 358 InvalidRoutingID: "invalid routing id", 359 InvalidRoutingPolicy: "invalid routing policy, only support (RulePolicy,MetadataPolicy)", 360 InvalidRoutingName: "invalid routing name", 361 362 NamespaceExistedConfigGroups: "some config group existed in namespace", 363 } 364 365 // code to info 366 func Code2Info(code uint32) string { 367 info, ok := code2info[code] 368 if ok { 369 return info 370 } 371 372 return "" 373 }