MCPcopy Index your code
hub / github.com/expr-lang/expr / ErrorAs

Function ErrorAs

internal/testify/require/require.go:299–307  ·  view source on GitHub ↗

ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. This is a wrapper for errors.As.

(t TestingT, err error, target interface{}, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

297// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value.
298// This is a wrapper for errors.As.
299func ErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{}) {
300 if h, ok := t.(tHelper); ok {
301 h.Helper()
302 }
303 if assert.ErrorAs(t, err, target, msgAndArgs...) {
304 return
305 }
306 t.FailNow()
307}
308
309// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value.
310// This is a wrapper for errors.As.

Callers 1

ErrorAsMethod · 0.70

Calls 3

ErrorAsFunction · 0.92
FailNowMethod · 0.65
HelperMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…