errors

package
v1.2.1-0...-ab03a5d Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Warnings (class 01XXX)
	Warning uint64 = 1 << 12

	// Faucet (class 012XX)
	Faucet = Warning + 2<<8 // Faucet credit denied

	// Invalid Nonce warnings(class 013xx)
	InvalidNonce        = Warning + 3<<8
	InvalidNonceTooHigh = InvalidNonce + 1
	InvalidNonceTooLow  = InvalidNonce + 2

	// Connection Errors (class 08XXX)
	Connection         uint64 = 8 << 12
	KafkaConnection           = Connection + 1<<8 // Kafka Connection error (subclass 081XX)
	HTTPConnection            = Connection + 2<<8 // HTTP Connection error (subclass 082XX)
	EthConnection             = Connection + 3<<8 // Ethereum Connection error (subclass 083XX)
	RedisConnection           = Connection + 5<<8 // Redis Connection error (subclass 085XX)
	PostgresConnection        = Connection + 6<<8 // Postgres Connection error (subclass 086XX)
	ServiceConnection         = Connection + 7<<8 // Service Connection error (subclass 087XX)

	// Authentication Errors (class 09XXX)
	InvalidAuthentication uint64 = 9 << 12
	Unauthorized                 = InvalidAuthentication + 1 // Invalid request credentials (code 09001)
	PermissionDenied             = InvalidAuthentication + 2 // no permission to execute operation (code 09002)

	// Feature Not Supported Errors (class 0AXXX)
	FeatureNotSupported uint64 = 10 << 12

	// Invalid State (class 24XXX)
	InvalidState uint64 = 2<<16 + 4<<12
	Conflicted          = InvalidState + 2<<8 // Conflict with current system state (subclass 242XX)

	// Message Errors (class 42XXX)
	Data               uint64 = 4<<16 + 2<<12
	Encoding                  = Data + 1<<8  // Invalid Encoding (subclass 421XX)
	Solidity                  = Data + 2<<8  // Solidity Errors (subclass 422XX)
	InvalidSignature          = Solidity + 1 // Invalid method/event signature (code 42201)
	InvalidArgsCount          = Solidity + 2 // Invalid arguments count (code 42202)
	InvalidArg                = Solidity + 3 // Invalid argument format (code 42203)
	InvalidTopicsCount        = Solidity + 4 // Invalid count of topics in receipt (code 42204)
	InvalidLog                = Solidity + 5 // Invalid event log (code 42205)
	InvalidFormat             = Data + 3<<8  // Invalid format (subclass 423XX)
	InvalidParameter          = Data + 4<<8  // Invalid parameter provided (subclass 424XX)

	// Ethereum error (class BEXXX)
	Ethereum        uint64 = 11<<16 + 14<<12
	NonceTooLow            = Ethereum + 1
	InvalidNonceErr        = Ethereum + 2

	// Cryptographic operation error (class C0XXX)
	CryptoOperation               uint64 = 12 << 16
	InvalidCryptographicSignature        = CryptoOperation + 1 // Invalid signature during cryptographic verification (subclass C0001)

	// Storage Error (class DBXXX)
	Storage            uint64 = 13<<16 + 11<<12
	ConstraintViolated        = Storage + 1<<8         // Storage constraint violated (subclass DB1XX)
	AlreadyExists             = ConstraintViolated + 1 // A resource with same index already exists (code DB101)
	NotFound                  = Storage + 2<<8         // Not found (subclass DB2XX)

	// Configuration errors (class F0XXX)
	Config uint64 = 15 << 16

	// Internal errors (class FFXXX)
	Internal          uint64 = 15<<16 + 15<<12
	DataCorrupted            = Internal + 1<<8 // Message corrupted (subclass FF1XX)
	DependencyFailure        = Internal + 2<<8 // Message corrupted (subclass FF2XX)
)

Error codes are uint64 for performances purposes but should be seen as 5 nibbles hex codes

Variables

This section is empty.

Functions

func AlreadyExistsError

func AlreadyExistsError(format string, a ...interface{}) *ierror.Error

AlreadyExistsError is raised when a Message constraint has been violated

func CombineErrors

func CombineErrors(errs ...error) error

func ConfigError

func ConfigError(format string, a ...interface{}) *ierror.Error

ConfigError is raised when an error is encountered while loading configuration

func ConflictedError

func ConflictedError(format string, a ...interface{}) *ierror.Error

ConflictedError is raised when operation could not be completed due to a conflict with the current state of the target resource

User might be able to resolve the conflict and resubmit operation

func ConnectionError

func ConnectionError(format string, a ...interface{}) *ierror.Error

ConnectionError is raised when failing to connect to an external service

func ConstraintViolatedError

func ConstraintViolatedError(format string, a ...interface{}) *ierror.Error

ConstraintViolatedError is raised when a Message constraint has been violated

func CryptoOperationError

func CryptoOperationError(format string, a ...interface{}) *ierror.Error

CryptoOperationError is raised when failing a cryptographic operation

func DataCorruptedError

func DataCorruptedError(format string, a ...interface{}) *ierror.Error

DataCorruptedError is raised loading a corrupted Message

func DataError

func DataError(format string, a ...interface{}) *ierror.Error

DataError is raised when a provided Message does not match expected format

func DependencyFailureError

func DependencyFailureError(format string, a ...interface{}) *ierror.Error

func EncodingError

func EncodingError(format string, a ...interface{}) *ierror.Error

EncodingError are raised when failing to decode a message

func Errorf

func Errorf(code uint64, format string, a ...interface{}) *ierror.Error

Errorf creates an error according to a format specifier

func EthConnectionError

func EthConnectionError(format string, a ...interface{}) *ierror.Error

EthConnectionError is raised when failing to connect to Ethereum client jsonRPC API

func EthereumError

func EthereumError(format string, a ...interface{}) *ierror.Error

EthereumError is raised when JSON-RPC call returns an error (such as Nonce too Low)

func FaucetWarning

func FaucetWarning(format string, a ...interface{}) *ierror.Error

FaucetWarning are raised when a faucet credit has been denied

func FeatureNotSupportedError

func FeatureNotSupportedError(format string, a ...interface{}) *ierror.Error

FeatureNotSupportedError is raised when using a feature which is not implemented

func FromError

func FromError(err error) *ierror.Error

FromError cast a golang error into an internal Error

if `err` is an internal then it is returned

func HTTPConnectionError

func HTTPConnectionError(format string, a ...interface{}) *ierror.Error

HTTPConnectionError is raised when failing to connect over http

func InternalError

func InternalError(format string, a ...interface{}) *ierror.Error

InternalError is raised when an unknown exception is met

func InvalidArgError

func InvalidArgError(format string, a ...interface{}) *ierror.Error

InvalidArgError is raised when invalid argument is provided to craft a transaction

func InvalidArgsCountError

func InvalidArgsCountError(format string, a ...interface{}) *ierror.Error

InvalidArgsCountError is raised when invalid arguments count is provided to craft a transaction

func InvalidAuthenticationError

func InvalidAuthenticationError(format string, a ...interface{}) *ierror.Error

InvalidAuthenticationError is raised when access to an operation has been denied

func InvalidCryptographicSignatureError

func InvalidCryptographicSignatureError(format string, a ...interface{}) *ierror.Error

InvalidCryptographicSignature is raised when failing a signature cryptographic verification

func InvalidEventDataError

func InvalidEventDataError(format string, a ...interface{}) *ierror.Error

InvalidEventDataError is raised when event Message is invalid

func InvalidFormatError

func InvalidFormatError(format string, a ...interface{}) *ierror.Error

InvalidFormatError is raised when a Message does not match an expected format

func InvalidNonceError

func InvalidNonceError(format string, a ...interface{}) *ierror.Error

NonceTooLowWarning are raised when about to send a transaction with nonce too low

func InvalidNonceWarning

func InvalidNonceWarning(format string, a ...interface{}) *ierror.Error

InvalidNonceWarning are raised when an invalid nonce is detected

func InvalidParameterError

func InvalidParameterError(format string, a ...interface{}) *ierror.Error

InvalidParameterError is raised when a provided parameter invalid

func InvalidSignatureError

func InvalidSignatureError(format string, a ...interface{}) *ierror.Error

InvalidSignatureError is raised when a Solidity method signature is invalid

func InvalidStateError

func InvalidStateError(format string, a ...interface{}) *ierror.Error

InvalidStateError is raised when system state blocks operation execution

func InvalidTopicsCountError

func InvalidTopicsCountError(format string, a ...interface{}) *ierror.Error

InvalidTopicsCountError is raised when topics count is in receipt

func IsAlreadyExistsError

func IsAlreadyExistsError(err error) bool

IsAlreadyExistsError indicate whether an error is an already exists error

func IsConflictedError

func IsConflictedError(err error) bool

IsConflictedError indicate whether an error is an conflicted error

func IsConnectionError

func IsConnectionError(err error) bool

IsConnectionError indicate whether an error is a Connection error

func IsConstraintViolatedError

func IsConstraintViolatedError(err error) bool

IsConstraintViolatedError indicate whether an error is a constraint violated error

func IsCryptoOperationError

func IsCryptoOperationError(err error) bool

IsCryptoOperationError indicate whether an error is a cryptographic operation error

func IsDataCorruptedError

func IsDataCorruptedError(err error) bool

IsDataCorruptedError indicate whether an error is a data corrupted error

func IsDataError

func IsDataError(err error) bool

IsDataError indicate whether an error is a Message error

func IsDependencyFailureError

func IsDependencyFailureError(err error) bool

func IsEncodingError

func IsEncodingError(err error) bool

IsEncodingError indicate whether an error is a EncodingError error

func IsEthConnectionError

func IsEthConnectionError(err error) bool

IsEthConnectionError indicate whether an error is a EthConnection error

func IsEthereumError

func IsEthereumError(err error) bool

IsEthereumError indicate whether an error is an Ethereum error

func IsFaucetWarning

func IsFaucetWarning(err error) bool

IsFaucetWarning indicate whether an error is a faucet Warning

func IsFeatureNotSupportedError

func IsFeatureNotSupportedError(err error) bool

IsFeatureNotSupportedError indicate whether an error is a feature not supported error

func IsInternalError

func IsInternalError(err error) bool

IsInternalError indicate whether an error is an Internal error

func IsInvalidArgError

func IsInvalidArgError(err error) bool

func IsInvalidAuthenticationError

func IsInvalidAuthenticationError(err error) bool

AuthenticationError indicate whether an error is an authentication error

func IsInvalidCryptographicSignatureError

func IsInvalidCryptographicSignatureError(err error) bool

IsInvalidCryptographicSignatureError indicate whether an error is a signature cryptographic verification error

func IsInvalidFormatError

func IsInvalidFormatError(err error) bool

IsInvalidFormatError indicate whether an error is an invalid format error

func IsInvalidNonceWarning

func IsInvalidNonceWarning(err error) bool

IsInvalidNonceWarning indicate whether an error is an invalid nonce Warning

func IsInvalidParameterError

func IsInvalidParameterError(err error) bool

IsInvalidParameterError indicate whether an error is an invalid parameter error

func IsInvalidStateError

func IsInvalidStateError(err error) bool

AuthenticationError indicate whether an error is an invalid state error

func IsKafkaConnectionError

func IsKafkaConnectionError(err error) bool

IsKafkaConnectionError indicate whether an error is a KafkaConnection error

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError indicate whether an error is a no Message found error

func IsPostgresConnectionError

func IsPostgresConnectionError(err error) bool

IsPostgresConnectionError indicate whether an error is a Postgres connection error

func IsServiceConnectionError

func IsServiceConnectionError(err error) bool

IsServiceConnectionError indicate whether an error is a Service connection error

func IsSolidityError

func IsSolidityError(err error) bool

IsSolidityError indicate whether an error is a Solidity error

func IsStorageError

func IsStorageError(err error) bool

IsStorageError indicate whether an error is a Storage error

func IsUnauthorizedError

func IsUnauthorizedError(err error) bool

func IsWarning

func IsWarning(err error) bool

IsWarning indicate whether an error is a Warning

func KafkaConnectionError

func KafkaConnectionError(format string, a ...interface{}) *ierror.Error

KafkaConnectionError is raised when failing to connect to Kafka

func NonceTooHighWarning

func NonceTooHighWarning(format string, a ...interface{}) *ierror.Error

NonceTooHighWarning are raised when about to send a transaction with nonce too high

func NonceTooLowError

func NonceTooLowError(format string, a ...interface{}) *ierror.Error

NonceTooLowError is raised when JSON-RPC returns a "Nonce too low" when sending a transaction

func NonceTooLowWarning

func NonceTooLowWarning(format string, a ...interface{}) *ierror.Error

NonceTooLowWarning are raised when about to send a transaction with nonce too low

func NotFoundError

func NotFoundError(format string, a ...interface{}) *ierror.Error

NoDataFoundError is raised when accessing a missing Message

func PermissionDeniedError

func PermissionDeniedError(format string, a ...interface{}) *ierror.Error

PermissionDeniedError is raised when authentication credentials are invalid

func PostgresConnectionError

func PostgresConnectionError(format string, a ...interface{}) *ierror.Error

PostgresConnectionError is raised when failing to connect to Postgres

func RedisConnectionError

func RedisConnectionError(format string, a ...interface{}) *ierror.Error

RedisConnectionError is raised when failing to connect to Redis

func ServiceConnectionError

func ServiceConnectionError(format string, a ...interface{}) *ierror.Error

ServiceConnectionError is raised when failing to connect to another service

func SolidityError

func SolidityError(format string, a ...interface{}) *ierror.Error

SolidityError is raised when a Message related in transaction crafting is incorrect

func StorageError

func StorageError(format string, a ...interface{}) *ierror.Error

StorageError is raised when an error is encountered while accessing stored Message

func UnauthorizedError

func UnauthorizedError(format string, a ...interface{}) *ierror.Error

UnauthorizedError is raised when authentication credentials are invalid

func Warningf

func Warningf(format string, a ...interface{}) *ierror.Error

Warningf are raised to indicate a warning

Types

This section is empty.

Jump to

Keyboard shortcuts

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