stacktrace

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorStackTrace

type ErrorStackTrace struct {
	Cause      error
	StackTrace *StackTrace
}

ErrorStackTrace is a pair of an error and its stack trace.

func (ErrorStackTrace) Error

func (s ErrorStackTrace) Error() string

func (ErrorStackTrace) Format

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

nolint: errcheck

func (ErrorStackTrace) String

func (s ErrorStackTrace) String() string

type ErrorStackTraces

type ErrorStackTraces []ErrorStackTrace

ErrorStackTraces is a list of error stack traces.

func ExtractErrorStackTraces

func ExtractErrorStackTraces(err error) ErrorStackTraces

ExtractErrorStackTraces extracts the stack traces from the provided error and its causes. Sorted from oldest to newest.

func (ErrorStackTraces) Format

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

nolint: errcheck

func (ErrorStackTraces) String

func (s ErrorStackTraces) String() string

type Frame

type Frame struct {
	runtime.Frame
}

func (Frame) Format

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

nolint: errcheck

func (Frame) String

func (f Frame) String() string

type StackTrace

type StackTrace struct {
	PCS    []uintptr
	Frames []Frame
}

StackTrace is the type of the data for a call stack. This mirrors the type of the same name in github.com/cockroachdb/errors/errbase.StackTrace.

func Caller

func Caller(skip int) *StackTrace

Caller captures a stack trace of the specified depth, skipping the provided number of frames. skip=0 identifies the caller of Caller.

Alias of Capture

func Capture

func Capture(skip int) *StackTrace

Capture captures a stack trace of the specified depth, skipping the provided number of frames. skip=0 identifies the caller of Capture.

func ParsePCS

func ParsePCS(pcs []uintptr) *StackTrace

func (*StackTrace) Count

func (s *StackTrace) Count() int

Count reports the total number of frames in this stacktrace.

func (*StackTrace) Format

func (s *StackTrace) Format(fs fmt.State, verb rune)

Format formats the stack of Frames according to the fmt.Formatter interface.

func (*StackTrace) FramesStrings

func (s *StackTrace) FramesStrings() []string

FramesStrings returns the frames of this stacktrace as slice of strings.

func (*StackTrace) String

func (s *StackTrace) String() string

String returns a string representation of the stack trace.

Jump to

Keyboard shortcuts

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