status_codes

package
v0.18.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GeneralErr       = 999 // all errors without error code
	InvalidParams    = 1001
	IncorrectAddress = 100101

	IOError        = 1002
	IOErrorNodeKey = 100201

	ParseError           = 1003
	ParseErrorAddress    = 100301
	ParseErrorBadBTCTxn  = 100302
	ParseErrorBTCAddress = 100303

	ConfigurationError          = 1004
	ConfigurationErrorChainType = 100401

	ResourceNotFoundError = 1005
	AccountNotFound       = 100501
	DomainNotFound        = 100502
	CurrencyNotFound      = 100503
	TxNotFound            = 100504

	InternalError                           = 1006
	InternalErrorSerialization              = 100601
	InternalErrorSigning                    = 100602
	InternalErrorGeneratingKeyPair          = 100603
	InternalErrorGettingBalance             = 100604
	InternalErrorListValidators             = 100605
	InternalErrorGettingTracker             = 100606
	InternalErrorTrackerNotFound            = 100607
	InternalErrorTrackerBusy                = 100608
	InternalErrorTrackerInsufficientBalance = 100609
	InternalErrorListWitnesses              = 100610
	InternalErrorGettingProposal            = 100611
	InternalErrorGettingBidConv             = 100612

	ONSError                        = 1007
	ONSErrDomainMissing             = 100701
	ONSErrOwnerAddressMissing       = 100702
	ONSErrOnSaleFlagNotSet          = 100703
	ONSErrDomainExists              = 100704
	ONSErrDebitingFromAddress       = 100705
	ONSErrAddingToFeePool           = 100706
	ONSErrInvalidUri                = 100707
	ONSErrGettingParentName         = 100708
	ONSErrParentDoesNotExist        = 100709
	ONSErrParentNotOwned            = 100710
	ONSErrFailedToCalculateExpiry   = 100711
	ONSErrFailedToCreateDomain      = 100712
	ONSErrFailedAddingDomainToStore = 100713
	ONSErrInvalidDomainName         = 100714

	WalletError               = 2006
	WalletErrorAddingAccount  = 200601
	WalletErrorGettingAccount = 200602
	WalletErrorDeleteAccount  = 200603

	BalanceError
	BalanceErrorAddFailed   = 210600
	BalanceErrorMinusFailed = 210601

	AccountsError                     = 2007
	AccountsErrorGeneratingNewAccount = 200701

	// Transaction statuses
	TxErrMissingData        = 300101
	TxErrUnserializable     = 300102
	TxErrWrongTxType        = 300103
	TxErrInvalidAmount      = 300104
	TxErrInvalidPubKey      = 300105
	TxErrUnmatchedSigner    = 300106
	TxErrInvalidSignature   = 300107
	TxErrInvalidFeeCurrency = 300108
	TxErrInvalidFeePrice    = 300109
	TxErrPoolDoesNotExist   = 300113
	TxErrInsufficientFunds  = 300110
	TxErrGasOverflow        = 300111
	TxErrInvalidExtTx       = 300112
	TxErrMaliciousValidator = 300113

	ExternalErr                        = 400100
	ExternalErrBitcoinTxNotFound       = 400101
	ExternalErrGettingBTCTxn           = 400102
	ExternalErrNotEnoughConfirmations  = 400103
	ExternalErrNotSpendable            = 400104
	ExternalErrUnableToCreateEthTX     = 400105
	ExternalErrUnableToCreateOLTLockTX = 400106
	ErrUnmarshalingRedeem              = 400107

	//ERC20
	ExternalErrUnableToCreateErc20OLTLockTX = 500100
	ExternalErrTokenNotSuported             = 500101
	ExternalTransactionNotSupported         = 500102

	//ValidatorStore
	ValidatorsUnableGetList = 410100

	//Tracker
	ETHTrackerNotFoundFailed  = 600100
	ETHTrackerNotFoundSuccess = 600101
	ETHTrackerNotFoundOngoing = 600102
	ETHTrackerExists          = 600103
	ETHTrackerUnabletoSet     = 600104

	// Staking
	DelgErr                     = 6003
	DelgErrStakeAddressInUse    = 600301
	DelgErrStakeAddressMismatch = 600302

	NetDelgErr                              = 6005
	NetDelgErrGettingActiveDelgAmount       = 600501
	NetDelgErrDeductingActiveDelgAmount     = 600502
	NetDelgErrSettingActiveDelgAmount       = 600503
	NetDelgErrGettingDelgOption             = 600504
	NetDelgErrSettingPendingDelgAmount      = 600505
	NetDelgErrGettingPendingDelgAmount      = 600506
	NetDelgErrWithdraw                      = 600507
	NetDelgErrFinalizingDelgRewards         = 600508
	NetDelgErrAddingWithdrawAmountToBalance = 600509
	NetDelgErrReinvest                      = 600510

	GovErr                                = 7001
	GovErrGetProposalOptions              = 700101
	GovErrInvalidProposalId               = 700102
	GovErrInvalidProposalType             = 700103
	GovErrInvalidProposerAddr             = 700104
	GovErrInvalidProposalDesc             = 700105
	GovErrProposalExists                  = 700106
	GovErrProposalNotExists               = 700107
	GovErrAddingProposalToActiveStore     = 700108
	GovErrDeletingProposalFromActiveStore = 700109
	GovErrAddingProposalToPassedStore     = 700110
	GovErrAddingProposalToFailedStore     = 700111
	GovErrDeletingProposalFromFailedStore = 700112
	GovErrDeductFunding                   = 700113
	GovErrAddFunding                      = 700114
	GovErrInvalidFunderAddr               = 700115
	GovErrInvalidBeneficiaryAddr          = 700116
	GovErrGettingValidatorList            = 700117
	GovErrGettingWitnessList              = 700217
	GovErrSetupVotingValidator            = 700118
	GovErrProposalWithdrawNotEligible     = 700119
	GovErrNoSuchFunder                    = 700120
	GovErrVotingHeightReached             = 700121
	GovErrAddingVoteToVoteStore           = 700122
	GovErrPeekingVoteResult               = 700123
	GovErrUnmatchedProposer               = 700124
	GovErrInvalidVoterId                  = 700125
	GovErrInvalidValidatorAddr            = 700126
	GovErrInvalidVoteOpinion              = 700127
	GovErrVoteUpdate                      = 700128
	GovErrVoteDeleteVoteRecords           = 700129
	GovErrVoteCheckVoteResult             = 700130
	GovErrWithdrawCheckFundsFailed        = 700131
	GovErrUnauthorizedCall                = 700132
	GovErrStatusNotCompleted              = 700133
	GovErrStatusNotVoting                 = 700134
	GovErrStatusNotFunding                = 700135
	GovErrVotingTBD                       = 700136
	GovErrFinalizeDistributtionFailed     = 700137
	GovErrFinalizeConfigUpdateFailed      = 700138
	GovErrStatusUnableToSetFinalized      = 700139
	GovErrUnabletoQueryVoteResult         = 700140
	GovErrFundingDeadlineCrossed          = 700141
	StatusUnableToSetVoting               = 700142
	GovFundUnableToAdd                    = 700143
	GovFundUnableToDelete                 = 700144
	GovFundBalanceMismatch                = 700145
	GovErrUnableToSetFinalizeFailed       = 700146
	GovErrInvalidFundingGoal              = 700147
	GovErrInvalidPassPercentage           = 700148
	GovErrInvalidFundingDeadline          = 700149
	GovErrInvalidVotingDeadline           = 700150
	TxErrGettingETHOptions                = 700151
	TxErrGettingONSOptions                = 700152
	TxErrGettingBTCOptions                = 700153
	TxErrGettingRewardsOptions            = 700154
	TxErrGettingFeeOptions                = 700155
	TxErrValidateGovState                 = 700156
	TxErrGetStakingOptions                = 700158
	TxErrInvalidOptions                   = 700159
	TxErrEvidenceError                    = 700160

	//Rewards Error
	RewardsUnableToGetMaturedAmount = 800001
	RewardsUnableToWithdraw         = 800002
	RewardsYearRewardsMissing       = 800003

	TxErrVMExecution = 900001
)

Variables

View Source
var (
	ErrSerialization = ProtocolError{InternalErrorSerialization, "error in serialization"}

	ErrLoadingNodeKey = ProtocolError{IOErrorNodeKey, "error reading node key file"}
	ErrParsingAddress = ProtocolError{ParseErrorAddress, "error parsing address"}
	ErrChainType      = ProtocolError{ConfigurationErrorChainType, "error getting chain type"}

	ErrAddingAccount   = ProtocolError{WalletErrorAddingAccount, "error adding account to wallet"}
	ErrGettingAccount  = ProtocolError{WalletErrorGettingAccount, "error getting account from wallet"}
	ErrDeletingAccount = ProtocolError{WalletErrorDeleteAccount, "error in deleting account"}

	ErrGeneratingAccount = ProtocolError{AccountsErrorGeneratingNewAccount, "error generating new account"}
	ErrAccountNotFound   = ProtocolError{AccountNotFound, "account is not in wallet"}
	ErrSigningError      = ProtocolError{InternalErrorSigning, "error while signing"}
	ErrKeyGeneration     = ProtocolError{InternalErrorGeneratingKeyPair, "error generating key pair"}

	ErrGettingTracker  = ProtocolError{InternalErrorGettingTracker, "error getting tracker"}
	ErrTrackerNotFound = ProtocolError{InternalErrorTrackerNotFound, "tracker not found"}
	ErrTrackerBusy     = ProtocolError{InternalErrorTrackerBusy, "tracker busy"}
	ErrTrackerBalance  = ProtocolError{InternalErrorTrackerInsufficientBalance, "insufficient balance in tracker"}

	// Query errors
	ErrBadAddress      = ProtocolError{IncorrectAddress, "address incorrect"}
	ErrGettingBalance  = ProtocolError{InternalErrorGettingBalance, "error  getting balance"}
	ErrListValidators  = ProtocolError{InternalErrorListValidators, "error getting list of validators"}
	ErrListWitnesses   = ProtocolError{InternalErrorListWitnesses, "error getting list of witnesses"}
	ErrGetProposal     = ProtocolError{InternalErrorGettingProposal, "error getting proposal"}
	ErrFindingCurrency = ProtocolError{CurrencyNotFound, "error finding currency"}
	ErrGetTx           = ProtocolError{TxNotFound, "error get tx from tendermint"}

	// ONS errors
	ErrBadName                   = ProtocolError{ONSErrDomainMissing, "domain name not provided"}
	ErrBadOwner                  = ProtocolError{ONSErrOwnerAddressMissing, "owner address not provided"}
	ErrDomainNotFound            = ProtocolError{DomainNotFound, "domain not found"}
	ErrFlagNotSet                = ProtocolError{ONSErrOnSaleFlagNotSet, "onsale flag not set"}
	ErrDomainExists              = ProtocolError{ONSErrDomainExists, "domain already exists"}
	ErrDebitingFromAddress       = ProtocolError{ONSErrDebitingFromAddress, "cannot debit from address"}
	ErrAddingToFeePool           = ProtocolError{ONSErrAddingToFeePool, "cannot add to fee pool"}
	ErrInvalidUri                = ProtocolError{ONSErrInvalidUri, "invalid uri"}
	ErrGettingParentName         = ProtocolError{ONSErrGettingParentName, "cannot get parent name"}
	ErrParentDoesNotExist        = ProtocolError{ONSErrParentDoesNotExist, "parent domain does not exist"}
	ErrParentNotOwned            = ProtocolError{ONSErrParentNotOwned, "parent domain not owned"}
	ErrFailedToCalculateExpiry   = ProtocolError{ONSErrFailedToCalculateExpiry, "failed to calculate expiry"}
	ErrFailedToCreateDomain      = ProtocolError{ONSErrFailedToCreateDomain, "failed to create domain"}
	ErrFailedAddingDomainToStore = ProtocolError{ONSErrFailedAddingDomainToStore, "failed to add domain to store"}
	ErrInvalidDomainName         = ProtocolError{ONSErrInvalidDomainName, "invalid domain name"}

	// External Errors
	ErrBTCTxNotFound             = ProtocolError{ExternalErrBitcoinTxNotFound, "bitcoin txn not found"}
	ErrBadBTCAddress             = ProtocolError{ParseErrorBTCAddress, "bad btc address"}
	ErrBTCNotEnoughConfirmations = ProtocolError{ExternalErrNotEnoughConfirmations, "not enough btc confirmations"}
	ErrBTCNotSpendable           = ProtocolError{ExternalErrNotSpendable, "btc source not spendable"}
	ErrBTCReadingTxn             = ProtocolError{ExternalErrGettingBTCTxn, "err getting btc txn"}

	ErrBadBTCTxn = ProtocolError{ParseErrorBadBTCTxn, "bad btc txn"}

	//Ethereum Errors
	ErrPreparingETHLock      = ProtocolError{Code: ExternalErrUnableToCreateEthTX, Msg: "Unable to create an unsigned lock transaction for Ethereum"}
	ErrPreparingOLTLock      = ProtocolError{Code: ExternalErrUnableToCreateOLTLockTX, Msg: "Unable to create OLT lock Tx for Ethereum"}
	ErrPreparingErc20OLTLock = ProtocolError{Code: ExternalErrUnableToCreateErc20OLTLockTX, Msg: "Unable to create OLT lock Tx for ERC20 Token"}
	ErrUnmarshaling          = ProtocolError{Code: ErrUnmarshalingRedeem, Msg: "Unable to unmarshall the incoming transaction into struct ,Wrong Json data"}

	//Tracker Error
	ErrGettingTrackerStatusFailed  = ProtocolError{Code: ETHTrackerNotFoundFailed, Msg: "Ethereum Tracker not found in the Failed tracker store"}
	ErrGettingTrackerStatusSuccess = ProtocolError{Code: ETHTrackerNotFoundSuccess, Msg: "Ethereum Tracker not found in the Success tracker store"}
	ErrGettingTrackerStatusOngoing = ProtocolError{Code: ETHTrackerNotFoundOngoing, Msg: "Ethereum Tracker not found in the Ongoing tracker store"}
)

Status declarations

Functions

This section is empty.

Types

type ProtocolError

type ProtocolError struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

Protocol Error definition

func UnMarshalError added in v0.14.3

func UnMarshalError(str string) (ProtocolError, error)

func WrapError

func WrapError(err error, code int, msg string) *ProtocolError

func (ProtocolError) Error

func (se ProtocolError) Error() string

func (ProtocolError) ErrorMsg

func (se ProtocolError) ErrorMsg() string

func (ProtocolError) Marshal added in v0.14.3

func (se ProtocolError) Marshal() string

func (ProtocolError) Wrap

func (se ProtocolError) Wrap(err error) *ProtocolError

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL