{"record":{"id":"d46c1483b1404ac1","repo":"egametang/ET","slug":"text-2-index-0-chr-1-0-9","errorCode":null,"errorMessage":"text={2}, index={0}, chr='{1}', 0-9的数字或'}}'","messagePattern":"text=(.+?), index=(.+?), chr='(.+?)', 0-9的数字或'\\}\\}'","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"warning","filePath":"Packages/cn.etetet.packagemanager/Editor/Tools/StrUtil_StrChunk.cs","lineNumber":183,"sourceCode":"                        break;\n                }\n\n                //处理错误\n                if (throwError && throwErrId > -1)\n                {\n                    switch (throwErrId)\n                    {\n                        case 0:\n                            throw new Exception(string.Format(\"text={3}, index={0}, chr='{1}'：此处只能出现'{2}'\", i, c,\n                                                              lastChar, value));\n                        case 1:\n                            throw new Exception(string.Format(\"text={2}, index={0}, chr='{1}', 此处只能出现小写英文字符\", i, c,\n                                                              value));\n                        case 2:\n                            throw new Exception(string.Format(\"text={2}, index={0}, chr='{1}', 此处只能出现小写英文或1-9的数字\", i, c,\n                                                              value));\n                        case 3:\n                            throw new Exception(string.Format(\"text={2}, index={0}, chr='{1}', 0-9的数字或'}}'\", i, c,\n                                                              value));\n                    }\n                }\n\n                lastChar = c;\n            }\n\n            //结尾处理\n            if (state != ReadChunkState.ReadText)\n            {\n                if (throwError)\n                {\n                    throw new Exception(\"没有正确结束, state=\" + state.ToString());\n                }\n\n                sb.Append(keySb.ToString()).Append(indexSb.ToString());\n            }\n","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.packagemanager/Editor/Tools/StrUtil_StrChunk.cs#L165-L201","documentation":"StrUtil.GetStrChunk error case 3: while reading the numeric index (ReadIndex state), the parser expects more digits 0-9 or the closing '}'. Any other character after the index digits triggers this. Only thrown when throwError=true.","triggerScenarios":"A placeholder like '{key1a}' (letter after index), '{key1 }' (space before close), '{key1_' (symbol), or a missing closing brace with trailing junk.","commonSituations":"Typo in the index portion; missing closing brace; template imported with different delimiter conventions.","solutions":["Ensure the index is pure digits followed immediately by '}', e.g. '{key123}'.","Close every placeholder with '}' and remove stray characters.","Use throwError=false tolerant mode to find the exact location."],"exampleFix":"// before\nvar chunks = StrUtil.GetStrChunk(\"{key1a}\", throwError: true);\n\n// after\nvar chunks = StrUtil.GetStrChunk(\"{key1}\", throwError: true);","handlingStrategy":"validation","validationCode":"StrUtil.GetStrChunk(template, throwError: false);","typeGuard":null,"tryCatchPattern":"try { chunks = StrUtil.GetStrChunk(tpl, throwError: true); }\ncatch (Exception) { chunks = StrUtil.GetStrChunk(tpl, throwError: false); }","preventionTips":["Ensure index is digits-only followed immediately by }.","Close every placeholder.","Validate with tolerant mode to find the bad index."],"tags":["packagemanager","editor","parsing","string-template"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}