WaitAndRecover will block until all goroutines spawned with Go exit and will return a *panics.Recovered if one of the child goroutines panics.
()
| 45 | // WaitAndRecover will block until all goroutines spawned with Go exit and |
| 46 | // will return a *panics.Recovered if one of the child goroutines panics. |
| 47 | func (h *WaitGroup) WaitAndRecover() *panics.Recovered { |
| 48 | h.wg.Wait() |
| 49 | |
| 50 | // Return a recovered panic if we caught one from a child goroutine. |
| 51 | return h.pc.Recovered() |
| 52 | } |