pm_recovery

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsTTY bool

Functions

func PrintPrettyStack

func PrintPrettyStack(p interface{})

PrintPrettyStack prints readable stack trace Ported from chi's implementation, source: https://github.com/go-chi/chi/blob/7dbe9a0bd10f03c7841d0374af79d7fa32769a9f/middleware/recoverer.go#L52

func SubscriptionInterceptor

func SubscriptionInterceptor(opt ...Option) pm.SubscriptionInterceptor

SubscriptionInterceptor recover panic.

Types

type Option added in v0.1.0

type Option func(*options)

func WithDebugRecoveryHandler added in v0.1.0

func WithDebugRecoveryHandler() Option

WithDebugRecoveryHandler customizes the stdout of a panic to be more human readable.

func WithRecoveryHandler added in v0.1.0

func WithRecoveryHandler(f RecoveryHandlerFunc) Option

WithRecoveryHandler customizes the function for recovering from a panic.

type RecoveryHandlerFunc added in v0.1.0

type RecoveryHandlerFunc func(ctx context.Context, p interface{})

RecoveryHandlerFunc is a function that recovers from the panic `p`. The context can be used to extract metadata and context values.

Jump to

Keyboard shortcuts

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