errors

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomError

type CustomError interface {
	error
	GetMessage() string
	GetInternalError() error
}

CustomError is an customized error

type CustomizableError added in v1.0.14

type CustomizableError struct {
	Message       string
	InternalError error
}

CustomizableError is a error with a error with a customizable message

func (*CustomizableError) Error added in v1.0.14

func (e *CustomizableError) Error() string

func (*CustomizableError) GetInternalError added in v1.0.14

func (e *CustomizableError) GetInternalError() error

func (*CustomizableError) GetMessage added in v1.0.14

func (e *CustomizableError) GetMessage() string

type ErrorCallbacks

type ErrorCallbacks interface {
	GetCallback(err error) func(err error)
}

ErrorCallbacks is the definition of a object responsible to get the callbacks registereb by a ErrorManager object

type ErrorCatcher

type ErrorCatcher interface {
	CatchError(err error, errorfn func(error))
	CatchErrorAndFinally(err error, errorfn func(error), finallyfn func())
	OnErrorContinue(tryfn func())
	EvenErrorFinally(err error, finallyfn func())
	TryCatchError(tryfn func(), errorfn func(error))
	TryFinally(tryfn func(), finallyfn func())
	TryCatchErrorAndFinally(tryfn func(), errorfn func(error), finallyfn func())
}

ErrorCatcher defines a object responsible to catch the errors

func NewErrorCatcher

func NewErrorCatcher(logger logs.ErrorLogger) ErrorCatcher

NewErrorCatcher returns a ErrorCatcher object

type ErrorDefer

type ErrorDefer interface {
	TryThrowError(fnPipeError func(err error) error)
}

ErrorDefer is the definition of a object responsible to hanles errors

func NewErrorDefer

func NewErrorDefer(thrower ErrorThrower) ErrorDefer

NewErrorDefer return a ErrorDefer

type ErrorManager

type ErrorManager interface {
	On(err interface{}, callback func(err error))
}

ErrorManager is the definition of a object responsible to set callbacks to error definitions

func NewErrorManager

func NewErrorManager() ErrorManager

NewErrorManager returns a ErrorManager

type ErrorThrower

type ErrorThrower interface {
	Throw(err error)
}

ErrorThrower defines a object responsible to throws errors

func NewErrorThrower

func NewErrorThrower(errorCallbacks ErrorCallbacks) ErrorThrower

NewErrorThrower returns a ErrorThrower

Directories

Path Synopsis
ioc

Jump to

Keyboard shortcuts

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