MCPcopy Index your code
hub / github.com/gavv/httpexpect / Failure

Method Failure

assertion.go:263–289  ·  view source on GitHub ↗

Failure implements AssertionHandler.Failure.

(
	ctx *AssertionContext, failure *AssertionFailure,
)

Source from the content-addressed store, hash-verified

261
262// Failure implements AssertionHandler.Failure.
263func (h *DefaultAssertionHandler) Failure(
264 ctx *AssertionContext, failure *AssertionFailure,
265) {
266 if h.Formatter == nil {
267 panic("DefaultAssertionHandler.Formatter is nil")
268 }
269
270 switch failure.Severity {
271 case SeverityError:
272 if h.Reporter == nil {
273 panic("DefaultAssertionHandler.Reporter is nil")
274 }
275
276 msg := h.Formatter.FormatFailure(ctx, failure)
277
278 h.Reporter.Errorf("%s", msg)
279
280 case SeverityLog:
281 if h.Logger == nil {
282 return
283 }
284
285 msg := h.Formatter.FormatFailure(ctx, failure)
286
287 h.Logger.Logf("%s", msg)
288 }
289}

Callers 1

Calls 3

FormatFailureMethod · 0.65
ErrorfMethod · 0.65
LogfMethod · 0.65

Tested by 1