stack

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorMessageFor

func ErrorMessageFor(what error) string

ErrorMessageFor creates an error message for given error.

func Print

func Print(what interface{}, to io.Writer, framesToSkip int)

Print prints the given problem object (panic, error, ...) to a readable version to the writer.

func StringOf

func StringOf(what interface{}, framesToSkip int) string

StringOf converts the given problem object (panic, error, ...) to a string which is readable.

Types

type CauseEnabled

type CauseEnabled interface {
	Cause() interface{}
}

CauseEnabled represents an object that could have a Cause.

type Element added in v0.1.6

type Element struct {
	File      string
	ShortFile string
	Line      int
	Function  string
	Package   string
	Pc        uintptr
}

Element represents an element from the whole stack trace.

func (Element) String added in v0.1.6

func (i Element) String() string

type ErrorEnabled

type ErrorEnabled interface {
	Error() string
}

ErrorEnabled represents an object that has an Error message.

type HasStack added in v0.1.6

type HasStack interface {
	Stack() Stack
}

HasStack represents an object that has a Stack.

type MessageEnabled

type MessageEnabled interface {
	Message() string
}

MessageEnabled represents an object that has a Message.

type Stack

type Stack []Element

Stack represents the whole stack trace with a couple of Elements.

func CaptureStack

func CaptureStack(framesToSkip int) Stack

CaptureStack creates a new stack capture of the current stack. It is possible to cut off the returned stack with framesToSkip.

func (Stack) String

func (i Stack) String() string

Jump to

Keyboard shortcuts

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