{"record":{"id":"fc22dd633636e2d4","repo":"mikefarah/yq","slug":"pkg-v","errorCode":null,"errorMessage":"pkg: %v","messagePattern":"pkg: %v","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/yqlib/decoder_toml.go","lineNumber":259,"sourceCode":"\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported type %v\", tomlNode.Kind)\n\t}\n\n}\n\nfunc (dec *tomlDecoder) Decode() (*CandidateNode, error) {\n\tif dec.finished {\n\t\treturn nil, io.EOF\n\t}\n\t//\n\t// toml library likes to panic\n\tvar deferredError error\n\tdefer func() { //catch or finally\n\t\tif r := recover(); r != nil {\n\t\t\tvar ok bool\n\t\t\tdeferredError, ok = r.(error)\n\t\t\tif !ok {\n\t\t\t\tdeferredError = fmt.Errorf(\"pkg: %v\", r)\n\t\t\t}\n\t\t}\n\t}()\n\n\tlog.Debug(\"ok here we go\")\n\tvar runAgainstCurrentExp = false\n\tvar err error\n\tfor runAgainstCurrentExp || dec.parser.NextExpression() {\n\n\t\tif runAgainstCurrentExp {\n\t\t\tlog.Debug(\"running against current exp\")\n\t\t}\n\n\t\tcurrentNode := dec.parser.Expression()\n\n\t\tlog.Debugf(\"currentNode: %v \", currentNode.Kind)\n\t\trunAgainstCurrentExp, err = dec.processTopLevelNode(currentNode)\n\t\tif err != nil {","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/mikefarah/yq/blob/8b5af0694bb82b41d4ae180fac9972029066f90a/pkg/yqlib/decoder_toml.go#L241-L277","documentation":"Decode installs a recover() because the underlying TOML library panics on some malformed input instead of returning an error. This message is produced when the recovered panic value is not an error type (e.g. a string or runtime error), so it is wrapped as 'pkg: <panic>'. The real fault is a library-level panic during TOML parsing, not a yq check.","triggerScenarios":"Thrown at pkg/yqlib/decoder_toml.go:259 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the TOML input that triggered the library panic (commonly malformed tables, duplicate keys, or invalid values)","Validate the file with another TOML parser (e.g. tomlcheck) to locate the fault","Report the panic upstream to the TOML library if the input appears valid","Try a newer yq/TOML library version where the panic may be fixed"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8b5af0694bb82b41d4ae180fac9972029066f90a","analyzedAt":"2026-09-05T10:57:22.766Z","contentChangedAt":"2026-09-05T10:57:22.766Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}