internal

package
v0.0.0-...-9b78ba4 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrorf

func NewErrorf(code ErrorCode, format string, a ...interface{}) error

NewErrorf instantiates a new error.

func WrapErrorf

func WrapErrorf(orig error, code ErrorCode, format string, a ...interface{}) error

WrapErrorf returns a wrapped error.

Types

type Error

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

Error represents an error that could be wrapping another error, it includes a code for determining what triggered the error.

func (*Error) Code

func (e *Error) Code() ErrorCode

Code returns the code representing this error.

func (*Error) Error

func (e *Error) Error() string

Error returns the message, when wrapping errors the wrapped error is returned.

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap returns the wrapped error, if any.

type ErrorCode

type ErrorCode uint

ErrorCode defines supported error codes.

const (
	ErrorCodeUnknown ErrorCode = iota
	ErrorCodeNotFound
	ErrorCodeInvalidArgument
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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