func (catacomb *Catacomb) Kill(err error) {
	if err == tomb.ErrDying {
		err = errors.New("bad catacomb Kill: tomb.ErrDying")
	}
	cause := errors.Cause(err)
	if match, ok := cause.(dyingError); ok {
		if catacomb != match.catacomb {
			err = errors.Errorf("bad catacomb Kill: other catacomb's ErrDying")
		} else {
			err = tomb.ErrDying
		}
	}

	// TODO(fwereade) it's pretty clear that this ought to be a Kill(nil), and
	// the catacomb should be responsible for ranking errors, just like the
	// dependency.Engine does, rather than determining priority by scheduling
	// alone.
	catacomb.tomb.Kill(err)
}
// Kill kills the Catacomb's internal tomb with the supplied error, or one
// derived from it.
//  * if it's caused by this catacomb's ErrDying, it passes on tomb.ErrDying.
//  * if it's tomb.ErrDying, or caused by another catacomb's ErrDying, it passes
//    on a new error complaining about the misuse.
//  * all other errors are passed on unmodified.
// It's always safe to call Kill, but errors passed to Kill after the catacomb
// is dead will be ignored.
Kill kills the Catacomb's internal tomb with the supplied error, or one
derived from it.
if it's caused by this catacomb's ErrDying, it passes on tomb.ErrDying.
if it's tomb.ErrDying, or caused by another catacomb's ErrDying, it passes
on a new error complaining about the misuse.
all other errors are passed on unmodified.
It's always safe to call Kill, but errors passed to Kill after the catacomb
is dead will be ignored.
// Kill kills the Catacomb ' s internal tomb with the supplied error or one // derived from it . // * if it ' s caused by this catacomb ' s ErrDying it passes on tomb . ErrDying . // * if it ' s tomb . ErrDying or caused by another catacomb ' s ErrDying it passes // on a new error complaining about the misuse . // * all other errors are passed on unmodified . // It ' s always safe to call Kill but errors passed to Kill after the catacomb // is dead will be ignored .
func (catacomb *Catacomb) Kill(err error) {
	if err == tomb.ErrDying {
		err = errors.New("bad catacomb Kill: tomb.ErrDying")
	}
	cause := errors.Cause(err)
	if match, ok := cause.(dyingError); ok {
		if catacomb != match.catacomb {
			err = errors.Errorf("bad catacomb Kill: other catacomb's ErrDying")
		} else {
			err = tomb.ErrDying
		}
	}
	catacomb.tomb.Kill(err)
}
func ( catacomb * Catacomb ) Kill ( err error ) { if err == tomb . ErrDying { err = errors . New ( " " ) } cause := errors . Cause ( err ) if match , ok := cause . ( dyingError ) ; ok { if catacomb != match . catacomb { err = errors . Errorf ( " " ) } else { err = tomb . ErrDying } } catacomb . tomb . Kill ( err ) }
Kill kills the Catacomb's internal tomb with the supplied error, or one
derived from it.
Kill kills the Catacomb ' s internal tomb with the supplied error or one derived from it .
// TODO(fwereade) it's pretty clear that this ought to be a Kill(nil), and // the catacomb should be responsible for ranking errors, just like the // dependency.Engine does, rather than determining priority by scheduling // alone.