MCPcopy Create free account
hub / github.com/expr-lang/expr / Error

Method Error

internal/testify/assert/assertion_forward.go:231–236  ·  view source on GitHub ↗

Error asserts that a function returned an error (i.e. not `nil`). actualObj, err := SomeFunction() if a.Error(err) { assert.Equal(t, expectedError, err) }

(err error, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

229// assert.Equal(t, expectedError, err)
230// }
231func (a *Assertions) Error(err error, msgAndArgs ...interface{}) bool {
232 if h, ok := a.t.(tHelper); ok {
233 h.Helper()
234 }
235 return Error(a.t, err, msgAndArgs...)
236}
237
238// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value.
239// This is a wrapper for errors.As.

Callers

nothing calls this directly

Calls 2

ErrorFunction · 0.70
HelperMethod · 0.45

Tested by

no test coverage detected