goaterr

package
v0.0.0-...-a532a67 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: LGPL-3.0 Imports: 4 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendError

func AppendError(errs []error, newerrs ...error) []error

AppendError append error to error collection

func Errorf

func Errorf(format string, a ...interface{}) error

Errorf formats according to a format specifier and returns the string as a value that satisfies error.

func NewError

func NewError(msg string) error

NewError formats according to a format specifier and returns the string as a value that satisfies error.

func ToError

func ToError(errs []error) error

ToError return error object if error list is not empty or nil. Otherwise return error object.

func Wrap

func Wrap(msg string, errs ...error) error

Wrap function returns a new error that adds context to the original error by recording a stack trace at the point Wrap is called, together with the supplied message.

func Wrapf

func Wrapf(err error, format string, a ...interface{}) error

Wrapf formats according to a format specifier and returns the string as a value that satisfies error. And wrap a based error

Types

type CodeError

type CodeError interface {
	ErrorCode() int
}

CodeError represent interface for error with code

type Error

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

Error is goat error object

func (*Error) Error

func (err *Error) Error() (s string)

Error return goat error object with title and stacktrace

func (*Error) ErrorJSON

func (err *Error) ErrorJSON() string

ErrorJSON return error json tree

func (*Error) ErrorMessage

func (err *Error) ErrorMessage() string

ErrorMessage return error json tree

func (*Error) Stack

func (err *Error) Stack() string

Stack return error stack trace

func (*Error) String

func (err *Error) String() string

Format to string

func (*Error) Unwrap

func (err *Error) Unwrap() error

Unwrap return wrapped error

func (*Error) UnwrapAll

func (err *Error) UnwrapAll() []error

UnwrapAll return wrapped errors

type ErrorWrapper

type ErrorWrapper interface {
	Unwrap() error
}

ErrorWrapper represent interface for error wrapper

type ErrorsWrapper

type ErrorsWrapper interface {
	UnwrapAll() []error
}

ErrorsWrapper represent interface for error wrapper

type GoatError

type GoatError interface {
	JSONError
	CodeError
	TrackedError
	ErrorsWrapper
}

GoatError represent interface for goat error

type JSONError

type JSONError interface {
	ErrorJSON() string
}

JSONError represent interface for error serialized to json

type MessageError

type MessageError interface {
	ErrorMessage() string
}

MessageError represent interface for error with message

type TrackedError

type TrackedError interface {
	Stack() string
}

TrackedError is described tracked errors interface

Jump to

Keyboard shortcuts

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