cockroach: github.com/cockroachdb/cockroach/pkg/util/causer Index | Files

package causer

import "github.com/cockroachdb/cockroach/pkg/util/causer"

Index

Package Files

causer.go

func Visit Uses

func Visit(err error, f func(error) bool) bool

Visit walks along the chain of errors until it encounters the first one that does not implement Causer. The visitor is invoked with each error visited until there are no more errors to visit or the visitor returns true (which is then the return value of Visit as well). Returns false when the visitor never returns true or if the initial error is nil. Calling this method on a cyclic error chain results in an infinite loop.

type Causer Uses

type Causer interface {
    error
    Cause() error
}

A Causer is an error that wraps a causing error (which in turn could be another Causer). A Causer is usually constructed via errors.Wrap or Wrapf.

Package causer is imported by 3 packages. Updated 2019-07-16. Refresh now. Tools for package owners.