MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / errorHandler

Function errorHandler

internal/mcp/dispatch_http_advanced_test.go:891–896  ·  view source on GitHub ↗

errorHandler fails the test if invoked. Used to assert that a code path doesn't hit the handler at all.

(t *testing.T, msg string)

Source from the content-addressed store, hash-verified

889// errorHandler fails the test if invoked. Used to assert that a
890// code path doesn't hit the handler at all.
891func errorHandler(t *testing.T, msg string) http.Handler {
892 t.Helper()
893 return http.HandlerFunc(func(_ http.ResponseWriter, _ *http.Request) {
894 t.Errorf("unexpected handler call: %s", msg)
895 })
896}
897
898// requestCapture is a tiny helper that records the last request +
899// counts how many times it was called. Compatible with http.Handler

Calls

no outgoing calls

Tested by

no test coverage detected