status_codes

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: Apache-2.0 Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	InvalidParams       = 1001
	IncorrectAddress    = 100101
	DomainMissing       = 100102
	OwnerAddressMissing = 100103
	OnSaleFlagNotSet    = 100104

	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

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

	AccountsError                     = 2007
	AccountsErrorGeneratingNewAccount = 200701

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

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

	ERC20
	ExternalErrUnableToCreateErc20OLTLockTX = 500100
	ExternalErrTokenNotSuported             = 500101

	Tracker
	ETHTrackerNotFoundFailed  = 600100
	ETHTrackerNotFoundSuccess = 600101
	ETHTrackerNotFoundOngoing = 600102

	Governance
	GovErrVoteSetupValidator    = 700100
	GovErrVoteUpdateVote        = 700101
	GovErrVoteDeleteVoteRecords = 700102
	GovErrVoteCheckVoteResult   = 700103
)

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"}
	ErrFindingCurrency = ProtocolError{CurrencyNotFound, "error finding currency"}
	ErrGetTx           = ProtocolError{TxNotFound, "error get tx from tendermint"}

	// ONS errors
	ErrBadName        = ProtocolError{DomainMissing, "domain name not provided"}
	ErrBadOwner       = ProtocolError{OwnerAddressMissing, "owner address not provided"}
	ErrDomainNotFound = ProtocolError{DomainNotFound, "domain not found"}
	ErrFlagNotSet     = ProtocolError{OnSaleFlagNotSet, "onsale flag not set"}

	// 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
	Msg  string
}

Protocol Error definition

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) 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