Пример #1
0
func (c *ComposedHandler) callRcv(h bh.Handler, msg bh.Msg, ctx bh.RcvContext) (
	err error) {

	defer func() {
		r := recover()
		if r == nil {
			return
		}

		if d, ok := r.(time.Duration); ok {
			ctx.Snooze(d)
		}

		err = errors.New(fmt.Sprintf("%v", r))
	}()

	return h.Rcv(msg, ctx)
}