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

Function unwrapAll

assert/assertions.go:2261–2276  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

2259}
2260
2261func unwrapAll(err error) (errs []error) {
2262 errs = append(errs, err)
2263 switch x := err.(type) {
2264 case interface{ Unwrap() error }:
2265 err = x.Unwrap()
2266 if err == nil {
2267 return
2268 }
2269 errs = append(errs, unwrapAll(err)...)
2270 case interface{ Unwrap() []error }:
2271 for _, err := range x.Unwrap() {
2272 errs = append(errs, unwrapAll(err)...)
2273 }
2274 }
2275 return
2276}
2277
2278func buildErrorChainString(err error, withType bool) string {
2279 if err == nil {

Callers 1

buildErrorChainStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected