MCPcopy
hub / github.com/danielgtaylor/huma / TestErrorAs

Function TestErrorAs

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

Source from the content-addressed store, hash-verified

130}
131
132func TestErrorAs(t *testing.T) {
133 err := fmt.Errorf("wrapped: %w", huma.Error400BadRequest("test"))
134
135 var e huma.StatusError
136 require.ErrorAs(t, err, &e)
137 assert.Equal(t, 400, e.GetStatus())
138}
139
140func TestErrorWithHeaders(t *testing.T) {
141 _, api := humatest.New(t, huma.DefaultConfig("Test API", "1.0.0"))

Callers

nothing calls this directly

Calls 1

GetStatusMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…