From 0de04f1c995935224dcf82ed59fedb62bfb955c3 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Sat, 12 Apr 2025 18:21:18 +0800 Subject: [PATCH] docs: update the comment on Options.PanicHandler to match its behavior (#365) Fixes #364 --- options.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/options.go b/options.go index 182cd5a..eb56aeb 100644 --- a/options.go +++ b/options.go @@ -55,7 +55,9 @@ type Options struct { Nonblocking bool // PanicHandler is used to handle panics from each worker goroutine. - // if nil, panics will be thrown out again from worker goroutines. + // If nil, the default behavior is to capture the value given to panic + // and resume normal execution and print that value along with the + // stack trace of the goroutine PanicHandler func(any) // Logger is the customized logger for logging info, if it is not set, @@ -66,7 +68,7 @@ type Options struct { DisablePurge bool } -// WithOptions accepts the whole options config. +// WithOptions accepts the whole Options config. func WithOptions(options Options) Option { return func(opts *Options) { *opts = options