MCPcopy Index your code
hub / github.com/cockroachdb/errors / If

Function If

markers_api.go:55–57  ·  view source on GitHub ↗

If iterates on the error's causal chain and returns a predicate's return value the first time the predicate returns true. Note: if any of the error types has been migrated from a previous package location or a different type, ensure that RegisterTypeMigration() was called prior to If().

(err error, pred func(err error) (interface{}, bool))

Source from the content-addressed store, hash-verified

53// package location or a different type, ensure that
54// RegisterTypeMigration() was called prior to If().
55func If(err error, pred func(err error) (interface{}, bool)) (interface{}, bool) {
56 return markers.If(err, pred)
57}
58
59// IsAny is like Is except that multiple references are compared.
60//

Callers 1

IsTimeoutFunction · 0.92

Calls 1

IfFunction · 0.92

Tested by

no test coverage detected