MCPcopy Create free account
hub / github.com/dolanor/rip / extractErrorsSource

Function extractErrorsSource

error.go:222–237  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

220}
221
222func extractErrorsSource(err error) ErrorSource {
223 var errorSource ErrorSource
224
225 // use the Unwrap() []error from an errors.Join() just in case
226 errs, ok := err.(interface{ Unwrap() []error })
227 if ok {
228 for _, err := range errs.Unwrap() {
229 errorSource = extractErrorSource(errorSource, err)
230 }
231 } else {
232 errorSource = extractErrorSource(errorSource, err)
233 }
234
235 return errorSource
236
237}
238
239func extractErrorSource(errorSource ErrorSource, err error) ErrorSource {
240 esh, ok := err.(ErrorSourceHeader)

Callers 1

writeErrorFunction · 0.85

Calls 2

extractErrorSourceFunction · 0.85
UnwrapMethod · 0.80

Tested by

no test coverage detected