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))
| 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. |
| 198 | func F(fn func(...any)) { |
| 199 | r(recover(), func(w wrapError) { f(fn, w) }) |
| 200 | } |
| 201 | |
| 202 | func e(err error) { |
| 203 | we := wrapError{error: err} |