errors

package
v0.0.0-...-762ab57 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MPL-2.0 Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidCountry - invalid country error for validation
	ErrInvalidCountry = errors.New("invalid country")
	// ErrNoIdentityCountry - no specified identity country
	ErrNoIdentityCountry = errors.New("no identity country")
	// ErrConflictBAPReportEvent is an error created when trying to update a bat loss event with a different amount
	ErrConflictBAPReportEvent = errors.New("unable to record BAP report")
	// ErrConflictBATLossEvent is an error created when trying to update a bat loss event with a different amount
	ErrConflictBATLossEvent = errors.New("unable to update bat loss events")
	// ErrCertificateExpired - a certificate is expired
	ErrCertificateExpired = errors.New("certificate expired")
	// ErrMarshalTransferRequest - failed to marshal the transfer request
	ErrMarshalTransferRequest = errors.New("failed to marshal the transfer request")
	// ErrCreateTransferRequest - failed to create the transfer request
	ErrCreateTransferRequest = errors.New("failed to create the transfer request")
	// ErrSignTransferRequest - failed to sign the transfer request
	ErrSignTransferRequest = errors.New("failed to sign the transfer request")
	// ErrFailedClientRequest - failed to perform client request
	ErrFailedClientRequest = errors.New("failed to perform api request")
	// ErrFailedBodyRead - failed to read body
	ErrFailedBodyRead = errors.New("failed to read the transfer response")
	// ErrFailedBodyUnmarshal - failed to decode body
	ErrFailedBodyUnmarshal = errors.New("failed to unmarshal the transfer response")
	// ErrMissingWallet - missing wallet
	ErrMissingWallet = errors.New("missing wallet")
	// ErrNoDepositProviderDestination - no linked wallet
	ErrNoDepositProviderDestination = errors.New("no deposit provider destination for wallet for transfer")
	// ErrNotImplemented - this function is not yet implemented
	ErrNotImplemented = errors.New("this function is not yet implemented")
	// ErrNotFound - resource not found
	ErrNotFound = errors.New("not found")
	// ErrInternalServerError internal server error
	ErrInternalServerError = errors.New("server encountered an internal error and was unable to complete the request")
	// ErrBadRequest bad request error
	ErrBadRequest = errors.New("error bad request")
)

Functions

func IsErrAlreadyExists

func IsErrAlreadyExists(err error) bool

IsErrAlreadyExists is a helper method for determining if an error indicates the resource already exists

func IsErrForbidden

func IsErrForbidden(err error) bool

IsErrForbidden is a helper method for determining if an error indicates the action is forbidden

func IsErrInsufficientBalance

func IsErrInsufficientBalance(err error) bool

IsErrInsufficientBalance is a helper method for determining if an error indicates insufficient balance

func IsErrInvalidDestination

func IsErrInvalidDestination(err error) bool

IsErrInvalidDestination is a helper method for determining if an error indicates an invalid destination

func IsErrInvalidSignature

func IsErrInvalidSignature(err error) bool

IsErrInvalidSignature is a helper method for determining if an error indicates there was an invalid signature

func IsErrNotFound

func IsErrNotFound(err error) bool

IsErrNotFound is a helper method for determining if an error indicates a missing resource

func IsErrUnauthorized

func IsErrUnauthorized(err error) bool

IsErrUnauthorized is a helper method for determining if an error indicates the wallet unauthorized

func New

func New(cause error, message string, data interface{}) error

New creates a new response error

func Wrap

func Wrap(cause error, message string) error

Wrap wraps an error

Types

type Codified

type Codified struct {
	ErrCode string
	Retry   bool
}

Codified - implementation of DrainCodified

func (Codified) DrainCode

func (c Codified) DrainCode() (string, bool)

DrainCode - implementation of DrainCodified.DrainCode

type DrainCodified

type DrainCodified interface {
	// DrainCode - get the drain code from the interface implementation
	DrainCode() (string, bool)
}

DrainCodified - Job runner drain codified errors have DrainCode()

type ErrorBundle

type ErrorBundle struct {
	// contains filtered or unexported fields
}

ErrorBundle creates a new response error

func (ErrorBundle) Cause

func (e ErrorBundle) Cause() error

Cause returns the associated cause

func (ErrorBundle) Data

func (e ErrorBundle) Data() interface{}

Data from error origin

func (ErrorBundle) DataToString

func (e ErrorBundle) DataToString() string

DataToString returns string representation of data

func (ErrorBundle) Error

func (e ErrorBundle) Error() string

Error turns into an error

func (ErrorBundle) Unwrap

func (e ErrorBundle) Unwrap() error

Unwrap returns the associated cause

type MultiError

type MultiError struct {
	Errs []error
}

MultiError - allows for multiple errors, not necessarily chained

func (*MultiError) Append

func (me *MultiError) Append(err ...error)

Append - append new errors to this multierror

func (*MultiError) Count

func (me *MultiError) Count() int

Count - get the number of errors contained herein

func (*MultiError) Error

func (me *MultiError) Error() string

Error - implement Error interface

func (*MultiError) Unwrap

func (me *MultiError) Unwrap() error

Unwrap - implement Unwrap for unwrapping sub errors

Jump to

Keyboard shortcuts

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