{"record":{"id":"e5fd0a754789831f","repo":"googleapis/mcp-toolbox","slug":"error-making-http-request-s","errorCode":null,"errorMessage":"error making HTTP request: %s","messagePattern":"error making HTTP request: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/http/http.go","lineNumber":208,"sourceCode":"}\n\nfunc (s *Source) HttpBaseURL() string {\n\treturn s.BaseURL\n}\n\nfunc (s *Source) HttpQueryParams() map[string]string {\n\treturn s.QueryParams\n}\n\nfunc (s *Source) Client() *http.Client {\n\treturn s.client\n}\n\nfunc (s *Source) RunRequest(ctx context.Context, req *http.Request) (any, error) {\n\t// Make request and fetch response\n\tresp, err := s.Client().Do(req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error making HTTP request: %s\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\tvar body []byte\n\tbody, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif resp.StatusCode < 200 || resp.StatusCode > 299 {\n\t\tif s.ReturnFullError {\n\t\t\treturn nil, fmt.Errorf(\"unexpected status code: %d, response body: %s\", resp.StatusCode, string(body))\n\t\t}\n\n\t\tlogger, err := util.LoggerFromContext(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to get logger from ctx: %s\", err)\n\t\t}\n\t\tlogger.DebugContext(ctx, \"http source upstream error\", \"status\", resp.StatusCode, \"body\", truncateForLog(body, maxErrorBodyLogBytes))","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/http/http.go#L190-L226","documentation":"Error \"error making HTTP request: %s\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/sources/http/http.go:208 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}