errors

package
v0.0.0-...-a65319e Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvancedError

type AdvancedError struct {
	*SimpleError
	Operations []string `json:"operations"`
}

func (*AdvancedError) Error

func (err *AdvancedError) Error() SimpleError

func (*AdvancedError) ErrorWithOperations

func (err *AdvancedError) ErrorWithOperations() AdvancedError

func (*AdvancedError) ToJSON

func (err *AdvancedError) ToJSON() ([]byte, error)

func (*AdvancedError) WithMeta

func (err *AdvancedError) WithMeta(key, value string) *AdvancedError

func (*AdvancedError) WithOperations

func (err *AdvancedError) WithOperations(operation string) *AdvancedError

type CustomErrorList

type CustomErrorList struct {
	Errors []Error `json:"errors"`
}

func (*CustomErrorList) Append

func (errList *CustomErrorList) Append(ers ...Error) *CustomErrorList

func (*CustomErrorList) Get

func (errList *CustomErrorList) Get() *CustomErrorList

func (*CustomErrorList) GetErrors

func (errList *CustomErrorList) GetErrors() []Error

type Error

type Error interface {
	WithMeta(key, value string) *AdvancedError
	WithOperations(operation string) *AdvancedError
	Error() SimpleError
	ErrorWithOperations() AdvancedError
}

func NewError

func NewError(title string, detail string) Error

type ErrorList

type ErrorList interface {
	Append(ers ...Error) *CustomErrorList
	Get() *CustomErrorList
	GetErrors() []Error
}

func NewErrorList

func NewErrorList() ErrorList

type SimpleError

type SimpleError struct {
	ID     uuid.UUID         `json:"id"`
	Title  string            `json:"title"`
	Detail string            `json:"detail"`
	Meta   map[string]string `json:"meta"`
}

Jump to

Keyboard shortcuts

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