errors

package
v0.0.0-...-f5bbbf4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Connection     = "CN000"
	AKV            = "CN100"
	HashicorpVault = "CN200"
	AWS            = "CN300"
	Healthcheck    = "CN400"
	BlockchainNode = "CN500"
	Postgres       = "CN600"

	InvalidRequest   = "IR000"
	Unauthorized     = "IR100"
	NotSupported     = "IR200"
	NotImplemented   = "IR300"
	InvalidFormat    = "IR400"
	InvalidParameter = "IR500"
	Forbidden        = "IR600"
	TooManyRequest   = "IR700"
)
View Source
const (
	Data            = "DA000"
	Encoding        = "DA100"
	CryptoOperation = "DA200"
)
View Source
const (
	Internal          = "IN000"
	Config            = "IN100"
	DependencyFailure = "IN200"
)
View Source
const (
	Storage        = "ST000"
	NotFound       = "ST100"
	AlreadyExists  = "ST200"
	StatusConflict = "ST300"
)

Variables

View Source
var ErrNotImplemented = NotImplementedError("this operation is not yet implemented. Please contact your administrator")

nolint

View Source
var ErrNotSupported = NotSupportedError("this operation is not supported. Please contact your administrator")

Functions

func CombineErrors

func CombineErrors(errs ...error) error

func IsAKVError

func IsAKVError(err error) bool

IsAKVError indicate whether an error is an AKV client connection error

func IsAWSError

func IsAWSError(err error) bool

IsAWSError indicate whether an error is an AWS client connection error

func IsAlreadyExistsError

func IsAlreadyExistsError(err error) bool

IsAlreadyExistsError indicate whether an error is an already exists error

func IsConfigError

func IsConfigError(err error) bool

func IsCryptoOperationError

func IsCryptoOperationError(err error) bool

IsCryptoOperationError indicate whether an error is a CryptoOperationError 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 IsForbiddenError

func IsForbiddenError(err error) bool

func IsHashicorpVaultError

func IsHashicorpVaultError(err error) bool

IsHashicorpVaultError indicate whether an error is a Hashicorp Vault connection error

func IsHealthcheckError

func IsHealthcheckError(err error) bool

IsHealthcheckError indicate whether an error is a healthcheck error

func IsInvalidFormatError

func IsInvalidFormatError(err error) bool

IsInvalidFormatError indicate whether an error is an invalid format error

func IsInvalidParameterError

func IsInvalidParameterError(err error) bool

IsInvalidParameterError indicate whether an error is an invalid parameter error

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError indicate whether an error is a no Data found error

func IsNotImplementedError

func IsNotImplementedError(err error) bool

func IsNotSupportedError

func IsNotSupportedError(err error) bool

func IsPostgresError

func IsPostgresError(err error) bool

IsPostgresError indicate whether an error is a Postgres client connection error

func IsStatusConflictError

func IsStatusConflictError(err error) bool

IsStatusConflictError indicate whether an error is a status conflict error

func IsTooManyRequestError

func IsTooManyRequestError(err error) bool

func IsUnauthorizedError

func IsUnauthorizedError(err error) bool

Types

type Error

type Error struct {
	Message string
	Code    string
}

func AKVError

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

AKVError is raised when failing to perform on AKV client

func AWSError

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

AWSError is raised when failing to perform on AWS client

func AlreadyExistsError

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

AlreadyExistsError indicates a resource already exists

func BlockchainNodeError

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

BlockchainNodeError is raised when failing to perform a call to the Ethereum node

func ConfigError

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

func CryptoOperationError

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

CryptoOperationError are raised when failing to perform a crypto operation

func DependencyFailureError

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

func EncodingError

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

EncodingError are raised when failing to decode a message

func Errorf

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

func ForbiddenError

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

ForbiddenError is raised when the user cannot perform a given operation (missing permission)

func FromError

func FromError(err interface{}) *Error

func HashicorpVaultError

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

HashicorpVaultError is raised when failing to perform on Hashicorp Vault

func HealthcheckError

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

HealthcheckError is raised when failing to perform a health check

func InvalidFormatError

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

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

func InvalidParameterError

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

InvalidParameterError is raised when a provided parameter invalid

func NotFoundError

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

NotFoundError is raised when accessing a missing Data

func NotImplementedError

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

func NotSupportedError

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

NotSupportedError is raised when operation is not supported

func PostgresError

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

PostgresError is raised when failing to perform on Postgres client

func StatusConflictError

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

StatusConflictError indicate a status conflict

func TooManyRequestError

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

func UnauthorizedError

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

UnauthorizedError is raised when authentication credentials are invalid

func (*Error) Error

func (e *Error) Error() string

func (*Error) GetCode

func (e *Error) GetCode() string

func (*Error) GetMessage

func (e *Error) GetMessage() string

func (*Error) SetMessage

func (e *Error) SetMessage(format string, args ...interface{}) *Error

Jump to

Keyboard shortcuts

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