MCPcopy
hub / github.com/stretchr/testify / buildErrorChainString

Function buildErrorChainString

assert/assertions.go:2278–2295  ·  view source on GitHub ↗
(err error, withType bool)

Source from the content-addressed store, hash-verified

2276}
2277
2278func buildErrorChainString(err error, withType bool) string {
2279 if err == nil {
2280 return ""
2281 }
2282
2283 var chain string
2284 errs := unwrapAll(err)
2285 for i := range errs {
2286 if i != 0 {
2287 chain += "\n\t"
2288 }
2289 chain += fmt.Sprintf("%q", errs[i].Error())
2290 if withType {
2291 chain += fmt.Sprintf(" (%T)", errs[i])
2292 }
2293 }
2294 return chain
2295}

Callers 4

ErrorIsFunction · 0.85
NotErrorIsFunction · 0.85
ErrorAsFunction · 0.85
NotErrorAsFunction · 0.85

Calls 2

unwrapAllFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected