panics

package
v0.0.0-...-6a04f06 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Panicf

func Panicf(format string, args ...any)

Panicf panics with a formatted message.

func Recover

func Recover(e any) error

Recover wraps a panic into a *Error if e is not nil, includes the stack trace.

func RecoverNoStack

func RecoverNoStack(e any) error

RecoverNoStack wraps a panic into a *Error if e is not nil, skips the stack trace.

func RecoverStack

func RecoverStack(e any) (err error, stack []byte)

RecoverStack wraps a panic into a *Error if e is not nil, includes the stack trace.

Types

type Error

type Error struct {
	E     any
	Stack []byte
}

Error wraps a panic into an error, by default includes the stack trace.

func (*Error) Error

func (e *Error) Error() string

Error returns the error message.

Jump to

Keyboard shortcuts

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