Try executes f, catching any panic it might spawn. It is safe to call from multiple goroutines simultaneously.
(f func())
| 19 | // Try executes f, catching any panic it might spawn. It is safe |
| 20 | // to call from multiple goroutines simultaneously. |
| 21 | func (p *Catcher) Try(f func()) { |
| 22 | defer p.tryRecover() |
| 23 | f() |
| 24 | } |
| 25 | |
| 26 | func (p *Catcher) tryRecover() { |
| 27 | if val := recover(); val != nil { |