github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/errors/status/error__generated.go (about)

     1  // This is a generated source file. DO NOT EDIT
     2  // Source: status/error__generated.go
     3  
     4  package status
     5  
     6  import "github.com/machinefi/w3bstream/pkg/depends/kit/statusx"
     7  
     8  var _ statusx.Error = (*Error)(nil)
     9  
    10  func (v Error) StatusErr() *statusx.StatusErr {
    11  	return &statusx.StatusErr{
    12  		Key:       v.Key(),
    13  		Code:      v.Code(),
    14  		Msg:       v.Msg(),
    15  		CanBeTalk: v.CanBeTalk(),
    16  	}
    17  }
    18  
    19  func (v Error) Unwrap() error {
    20  	return v.StatusErr()
    21  }
    22  
    23  func (v Error) Error() string {
    24  	return v.StatusErr().Error()
    25  }
    26  
    27  func (v Error) StatusCode() int {
    28  	return statusx.StatusCodeFromCode(int(v))
    29  }
    30  
    31  func (v Error) Code() int {
    32  	if with, ok := (interface{})(v).(statusx.ServiceCode); ok {
    33  		return with.ServiceCode() + int(v)
    34  	}
    35  	return int(v)
    36  }
    37  
    38  func (v Error) Key() string {
    39  	switch v {
    40  	case BadRequest:
    41  		return "BadRequest"
    42  	case InvalidConfigType:
    43  		return "InvalidConfigType"
    44  	case DeprecatedProject:
    45  		return "DeprecatedProject"
    46  	case UnknownDeployCommand:
    47  		return "UnknownDeployCommand"
    48  	case InvalidCronExpressions:
    49  		return "InvalidCronExpressions"
    50  	case InvalidPrivateKey:
    51  		return "InvalidPrivateKey"
    52  	case InvalidDeleteCondition:
    53  		return "InvalidDeleteCondition"
    54  	case UnknownMonitorCommand:
    55  		return "UnknownMonitorCommand"
    56  	case InvalidContractLogIDs:
    57  		return "InvalidContractLogIDs"
    58  	case InvalidChainTxIDs:
    59  		return "InvalidChainTxIDs"
    60  	case InvalidChainHeightIDs:
    61  		return "InvalidChainHeightIDs"
    62  	case InvalidVMState:
    63  		return "InvalidVMState"
    64  	case InvalidAccessKeyIdentityType:
    65  		return "InvalidAccessKeyIdentityType"
    66  	case Unauthorized:
    67  		return "Unauthorized"
    68  	case InvalidAuthValue:
    69  		return "InvalidAuthValue"
    70  	case InvalidAuthAccountID:
    71  		return "InvalidAuthAccountID"
    72  	case NoProjectPermission:
    73  		return "NoProjectPermission"
    74  	case NoOperatorPermission:
    75  		return "NoOperatorPermission"
    76  	case NoAdminPermission:
    77  		return "NoAdminPermission"
    78  	case InvalidOldPassword:
    79  		return "InvalidOldPassword"
    80  	case InvalidNewPassword:
    81  		return "InvalidNewPassword"
    82  	case InvalidPassword:
    83  		return "InvalidPassword"
    84  	case InvalidEthLoginSignature:
    85  		return "InvalidEthLoginSignature"
    86  	case InvalidEthLoginMessage:
    87  		return "InvalidEthLoginMessage"
    88  	case InvalidAuthPublisherID:
    89  		return "InvalidAuthPublisherID"
    90  	case CurrentAccountAbsence:
    91  		return "CurrentAccountAbsence"
    92  	case InvalidEventChannel:
    93  		return "InvalidEventChannel"
    94  	case InvalidEventToken:
    95  		return "InvalidEventToken"
    96  	case InvalidAppletContext:
    97  		return "InvalidAppletContext"
    98  	case NoResourcePermission:
    99  		return "NoResourcePermission"
   100  	case InvalidAccessKey:
   101  		return "InvalidAccessKey"
   102  	case InvalidDataPushShouldAccount:
   103  		return "InvalidDataPushShouldAccount"
   104  	case InvalidDataPushShouldPublisher:
   105  		return "InvalidDataPushShouldPublisher"
   106  	case Forbidden:
   107  		return "Forbidden"
   108  	case DisabledAccount:
   109  		return "DisabledAccount"
   110  	case WhiteListForbidden:
   111  		return "WhiteListForbidden"
   112  	case UploadFileSizeLimit:
   113  		return "UploadFileSizeLimit"
   114  	case UploadFileMd5Unmatched:
   115  		return "UploadFileMd5Unmatched"
   116  	case UploadFileDiskLimit:
   117  		return "UploadFileDiskLimit"
   118  	case TopicAlreadySubscribed:
   119  		return "TopicAlreadySubscribed"
   120  	case OccupiedOperator:
   121  		return "OccupiedOperator"
   122  	case UnsupportedFSOperator:
   123  		return "UnsupportedFSOperator"
   124  	case AccessKeyExpired:
   125  		return "AccessKeyExpired"
   126  	case AccessKeyPermissionDenied:
   127  		return "AccessKeyPermissionDenied"
   128  	case NotFound:
   129  		return "NotFound"
   130  	case ProjectNotFound:
   131  		return "ProjectNotFound"
   132  	case ConfigNotFound:
   133  		return "ConfigNotFound"
   134  	case ResourceNotFound:
   135  		return "ResourceNotFound"
   136  	case AppletNotFound:
   137  		return "AppletNotFound"
   138  	case InstanceNotFound:
   139  		return "InstanceNotFound"
   140  	case StrategyNotFound:
   141  		return "StrategyNotFound"
   142  	case PublisherNotFound:
   143  		return "PublisherNotFound"
   144  	case AccountIdentityNotFound:
   145  		return "AccountIdentityNotFound"
   146  	case ResourcePermNotFound:
   147  		return "ResourcePermNotFound"
   148  	case CronJobNotFound:
   149  		return "CronJobNotFound"
   150  	case InstanceNotRunning:
   151  		return "InstanceNotRunning"
   152  	case BlockchainNotFound:
   153  		return "BlockchainNotFound"
   154  	case ContractLogNotFound:
   155  		return "ContractLogNotFound"
   156  	case ChainTxNotFound:
   157  		return "ChainTxNotFound"
   158  	case ChainHeightNotFound:
   159  		return "ChainHeightNotFound"
   160  	case AccountNotFound:
   161  		return "AccountNotFound"
   162  	case AccountPasswordNotFound:
   163  		return "AccountPasswordNotFound"
   164  	case OperatorNotFound:
   165  		return "OperatorNotFound"
   166  	case TrafficLimitNotFound:
   167  		return "TrafficLimitNotFound"
   168  	case ProjectOperatorNotFound:
   169  		return "ProjectOperatorNotFound"
   170  	case AccessKeyNotFound:
   171  		return "AccessKeyNotFound"
   172  	case InvalidDataPushPayload:
   173  		return "InvalidDataPushPayload"
   174  	case Conflict:
   175  		return "Conflict"
   176  	case ProjectNameConflict:
   177  		return "ProjectNameConflict"
   178  	case ResourceConflict:
   179  		return "ResourceConflict"
   180  	case ResourceOwnerConflict:
   181  		return "ResourceOwnerConflict"
   182  	case StrategyConflict:
   183  		return "StrategyConflict"
   184  	case ConfigConflict:
   185  		return "ConfigConflict"
   186  	case PublisherConflict:
   187  		return "PublisherConflict"
   188  	case MultiInstanceDeployed:
   189  		return "MultiInstanceDeployed"
   190  	case AppletNameConflict:
   191  		return "AppletNameConflict"
   192  	case CronJobConflict:
   193  		return "CronJobConflict"
   194  	case ContractLogConflict:
   195  		return "ContractLogConflict"
   196  	case ChainTxConflict:
   197  		return "ChainTxConflict"
   198  	case ChainHeightConflict:
   199  		return "ChainHeightConflict"
   200  	case AccountIdentityConflict:
   201  		return "AccountIdentityConflict"
   202  	case AccountConflict:
   203  		return "AccountConflict"
   204  	case AccountPasswordConflict:
   205  		return "AccountPasswordConflict"
   206  	case OperatorConflict:
   207  		return "OperatorConflict"
   208  	case TrafficLimitConflict:
   209  		return "TrafficLimitConflict"
   210  	case ProjectOperatorConflict:
   211  		return "ProjectOperatorConflict"
   212  	case AccessKeyNameConflict:
   213  		return "AccessKeyNameConflict"
   214  	case TooManyRequest:
   215  		return "TooManyRequest"
   216  	case TrafficLimitExceededFailed:
   217  		return "TrafficLimitExceededFailed"
   218  	case InternalServerError:
   219  		return "InternalServerError"
   220  	case DatabaseError:
   221  		return "DatabaseError"
   222  	case UploadFileFailed:
   223  		return "UploadFileFailed"
   224  	case FetchResourceFailed:
   225  		return "FetchResourceFailed"
   226  	case ConfigInitFailed:
   227  		return "ConfigInitFailed"
   228  	case ConfigUninitFailed:
   229  		return "ConfigUninitFailed"
   230  	case ConfigParseFailed:
   231  		return "ConfigParseFailed"
   232  	case CreateInstanceFailed:
   233  		return "CreateInstanceFailed"
   234  	case BatchRemoveAppletFailed:
   235  		return "BatchRemoveAppletFailed"
   236  	case MqttSubscribeFailed:
   237  		return "MqttSubscribeFailed"
   238  	case MqttConnectFailed:
   239  		return "MqttConnectFailed"
   240  	case BatchRemoveWasmLogFailed:
   241  		return "BatchRemoveWasmLogFailed"
   242  	case GenTokenFailed:
   243  		return "GenTokenFailed"
   244  	case CreateTrafficSchedulerFailed:
   245  		return "CreateTrafficSchedulerFailed"
   246  	case UpdateTrafficSchedulerFailed:
   247  		return "UpdateTrafficSchedulerFailed"
   248  	}
   249  	return "UNKNOWN"
   250  }
   251  
   252  func (v Error) Msg() string {
   253  	switch v {
   254  	case BadRequest:
   255  		return "BadRequest"
   256  	case InvalidConfigType:
   257  		return "Invalid Config Type"
   258  	case DeprecatedProject:
   259  		return "Deprecated Project"
   260  	case UnknownDeployCommand:
   261  		return "Unknown Deploy Command"
   262  	case InvalidCronExpressions:
   263  		return "Invalid Cron Expressions"
   264  	case InvalidPrivateKey:
   265  		return "Invalid Private Key"
   266  	case InvalidDeleteCondition:
   267  		return "Invalid Delete Condition"
   268  	case UnknownMonitorCommand:
   269  		return "Unknown Deploy Command"
   270  	case InvalidContractLogIDs:
   271  		return "Invalid Contract Log IDs"
   272  	case InvalidChainTxIDs:
   273  		return "Invalid Chain Tx IDs"
   274  	case InvalidChainHeightIDs:
   275  		return "Invalid Chain Height IDs"
   276  	case InvalidVMState:
   277  		return "Invalid VM State"
   278  	case InvalidAccessKeyIdentityType:
   279  		return "Invalid Access Key Identity Type"
   280  	case Unauthorized:
   281  		return "unauthorized"
   282  	case InvalidAuthValue:
   283  		return "Invalid Auth Value"
   284  	case InvalidAuthAccountID:
   285  		return "Invalid Auth Account ID"
   286  	case NoProjectPermission:
   287  		return "No Project Permission"
   288  	case NoOperatorPermission:
   289  		return "No Operator Permission"
   290  	case NoAdminPermission:
   291  		return "No Admin Permission"
   292  	case InvalidOldPassword:
   293  		return "Invalid Old Password"
   294  	case InvalidNewPassword:
   295  		return "Invalid New Password"
   296  	case InvalidPassword:
   297  		return "Invalid Password"
   298  	case InvalidEthLoginSignature:
   299  		return "Invalid Siwe Signature"
   300  	case InvalidEthLoginMessage:
   301  		return "Invalid Siwe Message"
   302  	case InvalidAuthPublisherID:
   303  		return "Invalid Auth Publisher ID"
   304  	case CurrentAccountAbsence:
   305  		return "Current Account Absence"
   306  	case InvalidEventChannel:
   307  		return "Invalid Event Channel"
   308  	case InvalidEventToken:
   309  		return "Invalid Event Token"
   310  	case InvalidAppletContext:
   311  		return "Invalid Applet"
   312  	case NoResourcePermission:
   313  		return "No Resource Permission"
   314  	case InvalidAccessKey:
   315  		return "Invalid Account Access Key"
   316  	case InvalidDataPushShouldAccount:
   317  		return "invalid data push should account"
   318  	case InvalidDataPushShouldPublisher:
   319  		return "invalid data push should publisher"
   320  	case Forbidden:
   321  		return "forbidden"
   322  	case DisabledAccount:
   323  		return "Disabled Account"
   324  	case WhiteListForbidden:
   325  		return "White List Forbidden"
   326  	case UploadFileSizeLimit:
   327  		return "Upload File Size Limit"
   328  	case UploadFileMd5Unmatched:
   329  		return "Upload File Md5 Unmatched"
   330  	case UploadFileDiskLimit:
   331  		return "Upload File Disk Limit"
   332  	case TopicAlreadySubscribed:
   333  		return "Topic Already Subscribed"
   334  	case OccupiedOperator:
   335  		return "Occupied Operator"
   336  	case UnsupportedFSOperator:
   337  		return "Unsupported FileSystem Operator"
   338  	case AccessKeyExpired:
   339  		return "Account Access Key Expired"
   340  	case AccessKeyPermissionDenied:
   341  		return "Access Key Permission Denied"
   342  	case NotFound:
   343  		return "NotFound"
   344  	case ProjectNotFound:
   345  		return "Project Not Found"
   346  	case ConfigNotFound:
   347  		return "Config Not Found"
   348  	case ResourceNotFound:
   349  		return "Resource Not Found"
   350  	case AppletNotFound:
   351  		return "Applet Not Found"
   352  	case InstanceNotFound:
   353  		return "Instance Not Found"
   354  	case StrategyNotFound:
   355  		return "Strategy Not Found"
   356  	case PublisherNotFound:
   357  		return "Publisher Not Found"
   358  	case AccountIdentityNotFound:
   359  		return "Account Identity Not Found"
   360  	case ResourcePermNotFound:
   361  		return "Resource Perm Not Found"
   362  	case CronJobNotFound:
   363  		return "Cron Job Not Found"
   364  	case InstanceNotRunning:
   365  		return "Instance Not Running"
   366  	case BlockchainNotFound:
   367  		return "Blockchain Not Found"
   368  	case ContractLogNotFound:
   369  		return "Contract Log Not Found"
   370  	case ChainTxNotFound:
   371  		return "Chain Tx Not Found"
   372  	case ChainHeightNotFound:
   373  		return "Chain Height Not Found"
   374  	case AccountNotFound:
   375  		return "Account Not Found"
   376  	case AccountPasswordNotFound:
   377  		return "Account Password Not Found"
   378  	case OperatorNotFound:
   379  		return "Operator Not Found"
   380  	case TrafficLimitNotFound:
   381  		return "Traffic Limit Not Found"
   382  	case ProjectOperatorNotFound:
   383  		return "Project Operator relationship Not Found"
   384  	case AccessKeyNotFound:
   385  		return "Account Key Not Found"
   386  	case InvalidDataPushPayload:
   387  		return "invalid data push payload"
   388  	case Conflict:
   389  		return "Conflict conflict error"
   390  	case ProjectNameConflict:
   391  		return "Project Name Conflict"
   392  	case ResourceConflict:
   393  		return "Resource Conflict"
   394  	case ResourceOwnerConflict:
   395  		return "Resource Owner Conflict"
   396  	case StrategyConflict:
   397  		return "Strategy Conflict"
   398  	case ConfigConflict:
   399  		return "Config Conflict"
   400  	case PublisherConflict:
   401  		return "Publisher Conflict"
   402  	case MultiInstanceDeployed:
   403  		return "Multi Instance Deployed"
   404  	case AppletNameConflict:
   405  		return "Applet Name Conflict"
   406  	case CronJobConflict:
   407  		return "Cron Job Conflict"
   408  	case ContractLogConflict:
   409  		return "Contract Log Conflict"
   410  	case ChainTxConflict:
   411  		return "Chain Tx Conflict"
   412  	case ChainHeightConflict:
   413  		return "Chain Height Conflict"
   414  	case AccountIdentityConflict:
   415  		return "Account Identity Conflict"
   416  	case AccountConflict:
   417  		return "Account Conflict"
   418  	case AccountPasswordConflict:
   419  		return "Account Password Conflict"
   420  	case OperatorConflict:
   421  		return "Operator Conflict"
   422  	case TrafficLimitConflict:
   423  		return "Traffic Limit Conflict"
   424  	case ProjectOperatorConflict:
   425  		return "Project Operator relationship Conflict"
   426  	case AccessKeyNameConflict:
   427  		return "Access Key Name Conflict"
   428  	case TooManyRequest:
   429  		return "TooManyRequest too many request"
   430  	case TrafficLimitExceededFailed:
   431  		return "Traffic Limit Exceeded Failed"
   432  	case InternalServerError:
   433  		return "internal error"
   434  	case DatabaseError:
   435  		return "Database Error"
   436  	case UploadFileFailed:
   437  		return "Upload File Failed"
   438  	case FetchResourceFailed:
   439  		return "Fetch Resource Failed"
   440  	case ConfigInitFailed:
   441  		return "Config Init Failed"
   442  	case ConfigUninitFailed:
   443  		return "Config Uninit Failed"
   444  	case ConfigParseFailed:
   445  		return "Config Parse Failed"
   446  	case CreateInstanceFailed:
   447  		return "Create Instance Failed"
   448  	case BatchRemoveAppletFailed:
   449  		return "Batch Remove Applet Failed"
   450  	case MqttSubscribeFailed:
   451  		return "MQTT Subscribe Failed"
   452  	case MqttConnectFailed:
   453  		return "MQTT Connect Failed"
   454  	case BatchRemoveWasmLogFailed:
   455  		return "Batch Remove WasmLog Failed"
   456  	case GenTokenFailed:
   457  		return "Gen Token Failed"
   458  	case CreateTrafficSchedulerFailed:
   459  		return "Create Traffic Scheduler Failed"
   460  	case UpdateTrafficSchedulerFailed:
   461  		return "Update Traffic Scheduler Failed"
   462  	}
   463  	return "-"
   464  }
   465  
   466  func (v Error) CanBeTalk() bool {
   467  	switch v {
   468  	case BadRequest:
   469  		return true
   470  	case InvalidConfigType:
   471  		return true
   472  	case DeprecatedProject:
   473  		return true
   474  	case UnknownDeployCommand:
   475  		return true
   476  	case InvalidCronExpressions:
   477  		return true
   478  	case InvalidPrivateKey:
   479  		return true
   480  	case InvalidDeleteCondition:
   481  		return true
   482  	case UnknownMonitorCommand:
   483  		return true
   484  	case InvalidContractLogIDs:
   485  		return true
   486  	case InvalidChainTxIDs:
   487  		return true
   488  	case InvalidChainHeightIDs:
   489  		return true
   490  	case InvalidVMState:
   491  		return true
   492  	case InvalidAccessKeyIdentityType:
   493  		return true
   494  	case Unauthorized:
   495  		return false
   496  	case InvalidAuthValue:
   497  		return true
   498  	case InvalidAuthAccountID:
   499  		return true
   500  	case NoProjectPermission:
   501  		return true
   502  	case NoOperatorPermission:
   503  		return true
   504  	case NoAdminPermission:
   505  		return true
   506  	case InvalidOldPassword:
   507  		return true
   508  	case InvalidNewPassword:
   509  		return true
   510  	case InvalidPassword:
   511  		return true
   512  	case InvalidEthLoginSignature:
   513  		return true
   514  	case InvalidEthLoginMessage:
   515  		return true
   516  	case InvalidAuthPublisherID:
   517  		return true
   518  	case CurrentAccountAbsence:
   519  		return true
   520  	case InvalidEventChannel:
   521  		return true
   522  	case InvalidEventToken:
   523  		return true
   524  	case InvalidAppletContext:
   525  		return true
   526  	case NoResourcePermission:
   527  		return true
   528  	case InvalidAccessKey:
   529  		return true
   530  	case InvalidDataPushShouldAccount:
   531  		return true
   532  	case InvalidDataPushShouldPublisher:
   533  		return true
   534  	case Forbidden:
   535  		return false
   536  	case DisabledAccount:
   537  		return true
   538  	case WhiteListForbidden:
   539  		return true
   540  	case UploadFileSizeLimit:
   541  		return true
   542  	case UploadFileMd5Unmatched:
   543  		return true
   544  	case UploadFileDiskLimit:
   545  		return true
   546  	case TopicAlreadySubscribed:
   547  		return true
   548  	case OccupiedOperator:
   549  		return true
   550  	case UnsupportedFSOperator:
   551  		return true
   552  	case AccessKeyExpired:
   553  		return true
   554  	case AccessKeyPermissionDenied:
   555  		return true
   556  	case NotFound:
   557  		return true
   558  	case ProjectNotFound:
   559  		return true
   560  	case ConfigNotFound:
   561  		return true
   562  	case ResourceNotFound:
   563  		return true
   564  	case AppletNotFound:
   565  		return true
   566  	case InstanceNotFound:
   567  		return true
   568  	case StrategyNotFound:
   569  		return true
   570  	case PublisherNotFound:
   571  		return true
   572  	case AccountIdentityNotFound:
   573  		return true
   574  	case ResourcePermNotFound:
   575  		return true
   576  	case CronJobNotFound:
   577  		return true
   578  	case InstanceNotRunning:
   579  		return true
   580  	case BlockchainNotFound:
   581  		return true
   582  	case ContractLogNotFound:
   583  		return true
   584  	case ChainTxNotFound:
   585  		return true
   586  	case ChainHeightNotFound:
   587  		return true
   588  	case AccountNotFound:
   589  		return true
   590  	case AccountPasswordNotFound:
   591  		return true
   592  	case OperatorNotFound:
   593  		return true
   594  	case TrafficLimitNotFound:
   595  		return true
   596  	case ProjectOperatorNotFound:
   597  		return true
   598  	case AccessKeyNotFound:
   599  		return true
   600  	case InvalidDataPushPayload:
   601  		return true
   602  	case Conflict:
   603  		return true
   604  	case ProjectNameConflict:
   605  		return true
   606  	case ResourceConflict:
   607  		return true
   608  	case ResourceOwnerConflict:
   609  		return true
   610  	case StrategyConflict:
   611  		return true
   612  	case ConfigConflict:
   613  		return true
   614  	case PublisherConflict:
   615  		return true
   616  	case MultiInstanceDeployed:
   617  		return true
   618  	case AppletNameConflict:
   619  		return true
   620  	case CronJobConflict:
   621  		return true
   622  	case ContractLogConflict:
   623  		return true
   624  	case ChainTxConflict:
   625  		return true
   626  	case ChainHeightConflict:
   627  		return true
   628  	case AccountIdentityConflict:
   629  		return true
   630  	case AccountConflict:
   631  		return true
   632  	case AccountPasswordConflict:
   633  		return true
   634  	case OperatorConflict:
   635  		return true
   636  	case TrafficLimitConflict:
   637  		return true
   638  	case ProjectOperatorConflict:
   639  		return true
   640  	case AccessKeyNameConflict:
   641  		return true
   642  	case TooManyRequest:
   643  		return true
   644  	case TrafficLimitExceededFailed:
   645  		return true
   646  	case InternalServerError:
   647  		return false
   648  	case DatabaseError:
   649  		return true
   650  	case UploadFileFailed:
   651  		return true
   652  	case FetchResourceFailed:
   653  		return true
   654  	case ConfigInitFailed:
   655  		return true
   656  	case ConfigUninitFailed:
   657  		return true
   658  	case ConfigParseFailed:
   659  		return true
   660  	case CreateInstanceFailed:
   661  		return true
   662  	case BatchRemoveAppletFailed:
   663  		return true
   664  	case MqttSubscribeFailed:
   665  		return true
   666  	case MqttConnectFailed:
   667  		return true
   668  	case BatchRemoveWasmLogFailed:
   669  		return true
   670  	case GenTokenFailed:
   671  		return true
   672  	case CreateTrafficSchedulerFailed:
   673  		return true
   674  	case UpdateTrafficSchedulerFailed:
   675  		return true
   676  	}
   677  	return false
   678  }