MCPcopy Create free account
hub / github.com/cloudflare/cfssl / TestErrorString

Function TestErrorString

errors/error_test.go:279–286  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

277}
278
279func TestErrorString(t *testing.T) {
280 msg := "Arbitrary error message"
281 err := Wrap(CertificateError, Unknown, errors.New(msg))
282 str := err.Error()
283 if str != `{"code":1000,"message":"`+msg+`"}` {
284 t.Fatal("Incorrect Error():", str)
285 }
286}
287
288func TestHTTP(t *testing.T) {
289 err := NewMethodNotAllowed("GET")

Callers

nothing calls this directly

Calls 3

WrapFunction · 0.85
NewMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…