errors

package
v2.36.6 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

Functions

func E

func E(op Op, args ...interface{}) error

func IsKind

func IsKind(want Kind, err error) bool

Types

type ErrLocation

type ErrLocation struct {
	File string
	Line int
}

func GetLocation added in v2.20.0

func GetLocation(err error) ErrLocation

func (ErrLocation) String added in v2.20.0

func (l ErrLocation) String() string

type Error

type Error struct {
	// Op is the operation being performed
	// this can be named by convention as packageName.FunctionName
	// eg: var op = "errors.E"
	// for methods on structs this can be packageName.structName.methodName
	Op       Op
	Kind     Kind
	Err      error
	Location ErrLocation
}

func (*Error) Error

func (e *Error) Error() string

func (Error) Unwrap

func (e Error) Unwrap() error

type HRE

type HRE string

type Kind

type Kind uint16
const (
	KindOther Kind = iota + 1
	KindInternal
	KindHasuraAPI
	KindBadInput
	KindNetwork
)

func GetKind

func GetKind(err error) Kind

func (Kind) String

func (k Kind) String() string

type Op

type Op string

func Ops

func Ops(err *Error) []Op

type Unwrapper

type Unwrapper interface {
	Unwrap() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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