{"record":{"id":"2b1569a00f1b3004","repo":"huiyadanli/RevokeMsgPatcher","slug":"match-inconformity","errorCode":"match_inconformity","errorMessage":"特征比对：以下功能补丁已经安装，请取消勾选！\n已安装功能：【{string.Join(\"、\", res.Item2)}】","messagePattern":"特征比对：以下功能补丁已经安装，请取消勾选！\n已安装功能：【(.+?)】","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"warning","filePath":"RevokeMsgPatcher/Matcher/ModifyFinder.cs","lineNumber":56,"sourceCode":"                            changes.Add(new Change(matchIndexs[i], pattern.Replace));\n                        }\n                    }\n                }\n            }\n\n            // 匹配数和期望的匹配数不一致时报错（当前一个特征会出现多次）\n            if (matchNum < replacePatterns.Count)\n            {\n                Tuple<bool, SortedSet<string>> res = IsAllReplaced(fileByteArray, replacePatterns);\n                if (res.Item1)\n                {\n                    throw new BusinessException(\"match_already_replace\", \"特征比对：当前应用已经安装了对应功能的补丁！\");\n                }\n                else\n                {\n                    if (res.Item2.Count > 0)\n                    {\n                        throw new BusinessException(\"match_inconformity\", $\"特征比对：以下功能补丁已经安装，请取消勾选！\\n已安装功能：【{string.Join(\"、\", res.Item2)}】\");\n                    }\n                    else\n                    {\n                        throw new BusinessException(\"match_inconformity\", $\"特征比对：当前特征码匹配数[{matchNum}]和期望的匹配数[{replacePatterns.Count}]不一致。\\n\" +\n                            $\"出现此种情况的一般有如下可能：\\n\" +\n                            $\"1. 你可能已经安装了某个功能的补丁，请选择未安装功能进行安装。\\n\" +\n                            $\"2. 如果当前版本为最新版本，特征码可能出现变化（可能性比较低），请联系作者处理。\");\n                    }\n                }\n            }\n            else\n            {\n                // 匹配数和需要替换的数量不一致时，可能时部分/所有特征已经被替换\n                if (matchNum != changes.Count)\n                {\n                    // 此逻辑在当前特征配置下不会进入，因为查找串和替换串当前全部都是不相同的\n                    if (changes.Count == 0)\n                    {","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/huiyadanli/RevokeMsgPatcher/blob/89cbbb3f0cc896d5d092de0199a635c5c39944b6/RevokeMsgPatcher/Matcher/ModifyFinder.cs#L38-L74","documentation":"matchNum was below the expected count and IsAllReplaced returned a non-empty set of already-replaced category names, but not all of them. FindChanges throws BusinessException('match_inconformity') listing those categories and telling the user to uncheck them.","triggerScenarios":"A subset of the selected feature categories is already patched in the DLL (search bytes gone, replace bytes present for those categories), while at least one selected category is not.","commonSituations":"User selects several features where some were installed in a previous run and others were not.","solutions":["Uncheck the categories named in the error message and retry.","Alternatively, restore the DLL to start from a clean state, then re-select features."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"static bool IsBusinessException(Exception e, string code) => e is BusinessException b && b.ErrorCode == code;\n\nstatic bool IsInconformity(Exception e) => IsBusinessException(e, \"match_inconformity\");","tryCatchPattern":"try\n{\n    modifier.ValidateAndFindModifyInfo(categories);\n}\ncatch (BusinessException ex) when (ex.ErrorCode == \"match_inconformity\")\n{\n    // Message lists already-installed categories; prompt to uncheck them.\n    MessageBox.Show(ex.Message);\n}","preventionTips":["Parse the listed categories from the message and auto-uncheck them in the UI.","Pre-scan installed features with ModifyFinder.FindReplacedFunction to gray them out.","Filter by ErrorCode 'match_inconformity', not by Chinese substring."],"tags":["matcher","business-exception","already-patched"],"backgroundTag":null,"analyzedSha":"89cbbb3f0cc896d5d092de0199a635c5c39944b6","analyzedAt":"2026-08-13T10:37:37.073Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}