MCPcopy Index your code
hub / github.com/expr-lang/expr / catchPanic

Function catchPanic

internal/spew/common.go:72–78  ·  view source on GitHub ↗

catchPanic handles any panics that might occur during the handleMethods calls.

(w io.Writer, v reflect.Value)

Source from the content-addressed store, hash-verified

70// catchPanic handles any panics that might occur during the handleMethods
71// calls.
72func catchPanic(w io.Writer, v reflect.Value) {
73 if err := recover(); err != nil {
74 w.Write(panicBytes)
75 fmt.Fprintf(w, "%v", err)
76 w.Write(closeParenBytes)
77 }
78}
79
80// handleMethods attempts to call the Error and String methods on the underlying
81// type the passed reflect.Value represents and outputs the result to Writer w.

Callers 1

handleMethodsFunction · 0.85

Calls 2

WriteMethod · 0.80
FprintfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…