MCPcopy Create free account
hub / github.com/dsnet/try / F

Function F

try.go:198–200  ·  view source on GitHub ↗

F recovers an error previously panicked with an E function, wraps it, and passes it to fn. The wrapping includes the file and line of the runtime frame in which it occurred. F pairs well with testing.TB.Fatal and log.Fatal.

(fn func(...any))

Source from the content-addressed store, hash-verified

196// The wrapping includes the file and line of the runtime frame in which it occurred.
197// F pairs well with testing.TB.Fatal and log.Fatal.
198func F(fn func(...any)) {
199 r(recover(), func(w wrapError) { f(fn, w) })
200}
201
202func e(err error) {
203 we := wrapError{error: err}

Callers 1

TestFFunction · 0.92

Calls 2

rFunction · 0.85
fFunction · 0.85

Tested by 1

TestFFunction · 0.74