(msg string)
| 134 | } |
| 135 | |
| 136 | func 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. |
no test coverage detected