stack_frame

package
v0.0.0-...-3525705 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf

func Errorf(format string, args ...any) error

func MakeErrorTreeOrErr

func MakeErrorTreeOrErr(
	err error,
	frames ...Frame,
) error

func Wrap

func Wrap(err error) error

func WrapSkip

func WrapSkip(skip int, err error) error

func Wrapf

func Wrapf(err error, format string, args ...any) error

Types

type ErrorAndFrame

type ErrorAndFrame struct {
	Err   error
	Frame Frame
}

func (ErrorAndFrame) Error

func (err ErrorAndFrame) Error() string

func (ErrorAndFrame) IsEmpty

func (err ErrorAndFrame) IsEmpty() bool

func (ErrorAndFrame) Unwrap

func (err ErrorAndFrame) Unwrap() error

type ErrorStackTracer

type ErrorStackTracer interface {
	error
	ShouldShowStackTrace() bool
}

type ErrorTree

type ErrorTree struct {
	Root        error
	Descendents errorsAndFrames
}

func (*ErrorTree) Append

func (tree *ErrorTree) Append(childError error, childFrame Frame)

func (*ErrorTree) Error

func (tree *ErrorTree) Error() string

func (*ErrorTree) GetErrorRoot

func (tree *ErrorTree) GetErrorRoot() error

func (*ErrorTree) GetErrorsAndFrames

func (tree *ErrorTree) GetErrorsAndFrames() []ErrorAndFrame

func (*ErrorTree) Unwrap

func (tree *ErrorTree) Unwrap() error

type ErrorsAndFramesGetter

type ErrorsAndFramesGetter interface {
	GetErrorRoot() error
	GetErrorsAndFrames() []ErrorAndFrame
}

type Frame

type Frame struct {
	Package     string
	Function    string
	Filename    string
	RelFilename string
	Line        int

	Prefix string
	// contains filtered or unexported fields
}

func MakeFrame

func MakeFrame(skip int) (frame Frame, ok bool)

func MakeFrameFromRuntimeFrame

func MakeFrameFromRuntimeFrame(runtimeFrame runtime.Frame) (frame Frame)

func MakeFrames

func MakeFrames(skip, count int) (frames []Frame)

func MustFrame

func MustFrame(skip int) Frame

func (Frame) Errorf

func (frame Frame) Errorf(format string, args ...any) error

func (Frame) FileNameLine

func (frame Frame) FileNameLine() string

func (Frame) IsEmpty

func (frame Frame) IsEmpty() bool

func (Frame) String

func (frame Frame) String() string

func (Frame) StringLogLine

func (frame Frame) StringLogLine() string

func (Frame) StringNoFunctionName

func (frame Frame) StringNoFunctionName() string

func (Frame) Wrap

func (frame Frame) Wrap(err error) error

If the frame is non-zero, return a wrapped error. Otherwise return the input error unwrapped.

func (Frame) Wrapf

func (frame Frame) Wrapf(err error, format string, args ...any) error

Source Files

  • error_and_frame.go
  • error_tree.go
  • errors_and_frames.go
  • frame.go
  • main.go

Jump to

Keyboard shortcuts

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