{"record":{"id":"009fb769ff1aae79","repo":"grafana/k6","slug":"error-handling-summary-object-s-w","errorCode":null,"errorMessage":"error handling summary object %s: %w","messagePattern":"error handling summary object (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/summary.go","lineNumber":223,"sourceCode":"\t\t\"checks\": checks,\n\t}\n}\n\nfunc getSummaryResult(rawResult sobek.Value) (map[string]io.Reader, error) {\n\tif common.IsNullish(rawResult) {\n\t\treturn nil, nil //nolint:nilnil // this is actually valid result in this case\n\t}\n\n\trawResultMap, ok := rawResult.Export().(map[string]any)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"handleSummary() should return a map with string keys\")\n\t}\n\n\tresults := make(map[string]io.Reader, len(rawResultMap))\n\tfor path, val := range rawResultMap {\n\t\treaderVal, err := common.GetReader(val)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error handling summary object %s: %w\", path, err)\n\t\t}\n\t\tresults[path] = readerVal\n\t}\n\n\treturn results, nil\n}\n","sourceCodeStart":205,"sourceCodeEnd":230,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/summary.go#L205-L230","documentation":"One entry of the object returned by handleSummary has a value that common.GetReader cannot convert to an io.Reader. Each value in the map must be a string, an object serializable to JSON, or otherwise readable; values such as functions, undefined, or exotic objects make GetReader fail, and the error names the offending destination key.","triggerScenarios":"Thrown at internal/js/summary.go:223 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make every value in the returned map a string or a JSON-safe object (e.g. JSON.stringify(data) or the textSummary helper output)","Identify the failing destination from the error message and inspect that key's value","Do not return functions, Symbols, or class instances as summary payloads"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}