func Stack(err error) (stack []error) {
	for ; err != nil; err = Cause(err) {
		stack = append(stack, err)
	}
	return
}
Stack returns the entire error stack, including the given error.
package errors
type causer interface {
	Cause() error
}
func (e *Error) setCause(cause error) {
	if cause == nil {
		panic("error cause should not be set if nil")
	}
	if e.cause != nil {
		panic("error cause should not be overwritten, you're probably doing the a.WithCause(b) the wrong way around")
	}
	if ttnErr, ok := From(cause); ok {
		e.cause = ttnErr
	} else {
		e.cause = cause
	}
	e.stack = callers(4)
	e.clearGRPCStatus()
}
func (e *Error) WithCause(cause error) *Error {
	if e == nil {
		return nil
	}
	dup := *e
	dup.setCause(cause)
	return &dup
}
func (d *Definition) WithCause(cause error) *Error {
	if d == nil {
		return nil
	}
	e := build(d, 0)  
	e.setCause(cause)
	return e
}
func (e *Error) Cause() error {
	if e == nil {
		return nil
	}
	return e.cause
}
func (*Definition) Cause() error { return nil }
func Cause(err error) error {
	c, ok := err.(causer)
	if !ok {
		return nil
	}
	return c.Cause()
}
func RootCause(err error) error {
	for err != nil {
		cause := Cause(err)
		if cause == nil {
			return err
		}
		err = cause
	}
	return err
}