{"record":{"id":"ccce468cdc10ab4b","repo":"JuliusBrussee/caveman","slug":"cachebench-unexpected-json-delimiter","errorCode":null,"errorMessage":"cachebench: unexpected JSON delimiter","messagePattern":"cachebench: unexpected JSON delimiter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/strictjson.go","lineNumber":86,"sourceCode":"\t\t\treturn errors.New(\"cachebench: invalid object close\")\n\t\t}\n\t\treturn nil\n\tcase '[':\n\t\tif root {\n\t\t\treturn errors.New(\"cachebench: JSON root must be object\")\n\t\t}\n\t\tfor decoder.More() {\n\t\t\tif err := validateUniqueJSONValue(decoder, false, depth+1); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tclosing, err := decoder.Token()\n\t\tif err != nil || closing != json.Delim(']') {\n\t\t\treturn errors.New(\"cachebench: invalid array close\")\n\t\t}\n\t\treturn nil\n\tdefault:\n\t\treturn errors.New(\"cachebench: unexpected JSON delimiter\")\n\t}\n}\n","sourceCodeStart":68,"sourceCodeEnd":89,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cachebench/strictjson.go#L68-L89","documentation":"The streaming decoder produced a json.Delim that is none of '{', '}', '[', ']' in a position expecting a structural token — effectively unreachable with encoding/json today, this guard defends the validator's switch against decoder changes and truly malformed token streams.","triggerScenarios":"Thrown at cacheengine/cachebench/strictjson.go:86 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Treat the payload as corrupt and regenerate it from a trusted serializer","Report the input as malformed if it reproduces; no valid JSON should reach this branch"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}