Skip to content

Commit 809a277

Browse files
lvan100lianghuan
authored andcommitted
111
1 parent 9c7fb83 commit 809a277

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

util/goutil/goutil.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737

3838
// OnPanic is a global callback function triggered when a panic occurs.
3939
var OnPanic = func(ctx context.Context, r any, stack []byte) {
40-
fmt.Printf("panic: %v\n%s\n", r, stack)
40+
fmt.Printf("[PANIC] %v\n%s\n", r, stack)
4141
}
4242

4343
/********************************** go ***************************************/
@@ -122,7 +122,7 @@ func GoValue[T any](ctx context.Context, f func(ctx context.Context) (T, error))
122122
if OnPanic != nil {
123123
OnPanic(ctx, r, stack)
124124
}
125-
s.err = util.FormatError(nil, "panic: %v\n%s", r, stack)
125+
s.err = util.FormatError(nil, "panic recovered: %v\n%s", r, stack)
126126
}
127127
}()
128128
s.val, s.err = f(ctx)

0 commit comments

Comments
 (0)