MCPcopy
hub / github.com/github/github-mcp-server / badRequestHandler

Function badRequestHandler

pkg/github/server_test.go:136–149  ·  view source on GitHub ↗
(msg string)

Source from the content-addressed store, hash-verified

134}
135
136func badRequestHandler(msg string) http.HandlerFunc {
137 return func(w http.ResponseWriter, _ *http.Request) {
138 structuredErrorResponse := gogithub.ErrorResponse{
139 Message: msg,
140 }
141
142 b, err := json.Marshal(structuredErrorResponse)
143 if err != nil {
144 http.Error(w, "failed to marshal error response", http.StatusInternalServerError)
145 }
146
147 http.Error(w, string(b), http.StatusBadRequest)
148 }
149}
150
151// TestNewMCPServer_CreatesSuccessfully verifies that the server can be created
152// with the deps injection middleware properly configured.

Callers 2

Test_GetMeFunction · 0.85
Test_GetTeamsFunction · 0.85

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected