errors

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As(err error, target interface{}) bool

func Errorf

func Errorf(fmt string, args ...interface{}) error

func New

func New(err error, trace ...Location) error

func Wrap

func Wrap(cause error, err error, trace ...Location) error

func Wrapf

func Wrapf(cause error, fmt string, args ...interface{}) error

Types

type Error

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

func (Error) Cause

func (e Error) Cause() error

func (Error) Error

func (e Error) Error() string

func (Error) Print

func (e Error) Print(out io.Writer)

func (Error) Trace

func (e Error) Trace() []Location

type Location

type Location struct {
	Name        string // Optional.
	VerboseName string // Optional.
	Line, Col   uint   // Optional, 0 - unused.
	Snippet            // Optional.
}

func (Location) Print

func (l Location) Print(out io.Writer)

type Snippet

type Snippet struct {
	LineOffset uint
	Lines      []string
}

func (Snippet) IsEmpty

func (s Snippet) IsEmpty() bool

func (Snippet) Print

func (r Snippet) Print(out io.Writer, line, col uint)

type Trace

type Trace interface {
	Trace() []Location
}

Jump to

Keyboard shortcuts

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