MCPcopy
hub / github.com/labstack/echo / TestDefaultHTTPErrorHandler_CommitedResponse

Function TestDefaultHTTPErrorHandler_CommitedResponse

echo_test.go:1396–1407  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1394}
1395
1396func TestDefaultHTTPErrorHandler_CommitedResponse(t *testing.T) {
1397 e := New()
1398 req := httptest.NewRequest(http.MethodGet, "/", nil)
1399 resp := httptest.NewRecorder()
1400 c := e.NewContext(req, resp)
1401
1402 c.orgResponse.Committed = true
1403 errHandler := DefaultHTTPErrorHandler(false)
1404
1405 errHandler(c, errors.New("my_error"))
1406 assert.Equal(t, http.StatusOK, resp.Code)
1407}
1408
1409func benchmarkEchoRoutes(b *testing.B, routes []testRoute) {
1410 e := New()

Callers

nothing calls this directly

Calls 3

NewFunction · 0.85
DefaultHTTPErrorHandlerFunction · 0.85
NewContextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…