MCPcopy Create free account
hub / github.com/aeilang/httpz / TestHTTPError_Error

Function TestHTTPError_Error

error_test.go:25–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23}
24
25func TestHTTPError_Error(t *testing.T) {
26 err := NewHTTPError(http.StatusNotFound, "not found")
27 assert.Equal(t, "code=404, message=not found", err.Error())
28
29 internalErr := errors.New("internal error")
30 err.SetInternal(internalErr)
31 assert.Equal(t, "code=404, message=not found, internal=internal error", err.Error())
32}
33
34func TestHTTPError_Unwrap(t *testing.T) {
35 internalErr := errors.New("internal error")

Callers

nothing calls this directly

Calls 3

ErrorMethod · 0.95
SetInternalMethod · 0.95
NewHTTPErrorFunction · 0.85

Tested by

no test coverage detected