faults

package
v2.39.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var As = errors.As
View Source
var Is = errors.Is

Functions

func Annotate

func Annotate(err error, msg string) error

Annotate adds contextual information to an existing error without capturing a new stack trace. A nil stack indicates that the original error's stack (if any) is preserved and no new origin is recorded.

func HasStack

func HasStack(err error) bool

func NewFault

func NewFault(msg string) error

func Root

func Root(err error) error

func WithStack

func WithStack(err error) error

func Wrap

func Wrap(err error, msg string) error

Types

type Error

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

func (*Error) Error

func (e *Error) Error() string

func (*Error) Format

func (e *Error) Format(s fmt.State, verb rune)

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Frame

type Frame uintptr

func Stack

func Stack(err error) []Frame

func (Frame) File

func (f Frame) File() string

func (Frame) Format

func (f Frame) Format(s fmt.State, verb rune)

Format implements fmt.Formatter. Supported verbs:

%v  - short file:line
%+v - full file:line with function name
%s  - file:line
%n  - function name only

func (Frame) Function

func (f Frame) Function() string

func (Frame) Line

func (f Frame) Line() int

Jump to

Keyboard shortcuts

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