Try executes f, catching and returning any panic it might spawn. The recovered panic can be propagated with panic(), or handled as a normal error with (*panics.Recovered).AsError().
(f func())
| 5 | // The recovered panic can be propagated with panic(), or handled as a normal error with |
| 6 | // (*panics.Recovered).AsError(). |
| 7 | func Try(f func()) *Recovered { |
| 8 | var c Catcher |
| 9 | c.Try(f) |
| 10 | return c.Recovered() |
| 11 | } |