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

Method elideShortChildren

errbase/format_error.go:509–513  ·  view source on GitHub ↗

elideShortChildren takes a number of entries to set `elideShort` to false. The reason a number of entries is needed is that we may be eliding a subtree of causes in the case of a multi-cause error. In the multi-cause case, we need to know how many of the prior errors in the list of entries is a chil

(newEntries int)

Source from the content-addressed store, hash-verified

507// the multi-cause case, we need to know how many of the prior errors
508// in the list of entries is a child of this subtree.
509func (s *state) elideShortChildren(newEntries int) {
510 for i := 0; i < newEntries; i++ {
511 s.entries[len(s.entries)-1-i].elideShort = true
512 }
513}
514
515func (s *state) collectEntry(err error, bufIsRedactable bool, withDepth bool, depth int) formatEntry {
516 entry := formatEntry{err: err}

Callers 1

formatRecursiveMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected