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

Function ErrorIs

require/require.go:368–376  ·  view source on GitHub ↗

ErrorIs asserts that at least one of the errors in err's chain matches target. This is a wrapper for errors.Is.

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

Source from the content-addressed store, hash-verified

366// ErrorIs asserts that at least one of the errors in err's chain matches target.
367// This is a wrapper for errors.Is.
368func ErrorIs(t TestingT, err error, target error, msgAndArgs ...interface{}) {
369 if h, ok := t.(tHelper); ok {
370 h.Helper()
371 }
372 if assert.ErrorIs(t, err, target, msgAndArgs...) {
373 return
374 }
375 t.FailNow()
376}
377
378// ErrorIsf asserts that at least one of the errors in err's chain matches target.
379// This is a wrapper for errors.Is.

Callers 1

ErrorIsMethod · 0.70

Calls 3

ErrorIsFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected