{"record":{"id":"6efb1e8f5c5382df","repo":"tui-cs/Terminal.Gui","slug":"invalid-tracecategory-value-in-array-value","errorCode":null,"errorMessage":"Invalid TraceCategory value in array: '{value}'","messagePattern":"Invalid TraceCategory value in array: '(.+?)'","errorType":"validation","errorClass":"JsonException","httpStatus":null,"severity":"error","filePath":"Terminal.Gui/Configuration/TraceCategoryJsonConverter.cs","lineNumber":57,"sourceCode":"            {\n                if (reader.TokenType == JsonTokenType.EndArray)\n                {\n                    break;\n                }\n\n                if (reader.TokenType != JsonTokenType.String)\n                {\n                    throw new JsonException ($\"Unexpected token type in TraceCategory array: {reader.TokenType}\");\n                }\n                string value = reader.GetString ()!;\n\n                if (Enum.TryParse (value, true, out TraceCategory category))\n                {\n                    result |= category;\n                }\n                else\n                {\n                    throw new JsonException ($\"Invalid TraceCategory value in array: '{value}'\");\n                }\n            }\n\n            return result;\n        }\n\n        throw new JsonException ($\"Unexpected token type for TraceCategory: {reader.TokenType}\");\n    }\n\n    public override void Write (Utf8JsonWriter writer, TraceCategory value, JsonSerializerOptions options)\n    {\n        if (value == TraceCategory.None)\n        {\n            writer.WriteStringValue (\"None\");\n\n            return;\n        }\n","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/tui-cs/Terminal.Gui/blob/2e47b11478db083499917f2ad27c34d30efb0df1/Terminal.Gui/Configuration/TraceCategoryJsonConverter.cs#L39-L75","documentation":"Thrown by TraceCategoryJsonConverter.Read while parsing the array form when an element IS a string but Enum.TryParse fails to map it to a TraceCategory member (case-insensitive). This is the per-element analog of error 90: at least one name in the array is invalid.","triggerScenarios":"A TraceCategory array containing a typo or unknown name, e.g. [\"Command\",\"Mose\"] or [\"Command\",\"Drawing\"] when Drawing isn't a member.","commonSituations":"Misspelling one element of a multi-category list; referencing a category removed/renamed in a newer Terminal.Gui version.","solutions":["Correct the offending element to a valid TraceCategory member name (the error message echoes the bad value in quotes).","Check the current TraceCategory enum definition for the available names.","Drop the invalid element entirely if it's no longer relevant."],"exampleFix":"// before\n\"TraceCategory\": [\"Command\", \"Mose\"]\n// after\n\"TraceCategory\": [\"Command\", \"Mouse\"]","handlingStrategy":"validation","validationCode":"bool AllValidNames (JsonElement el)\n    => el.EnumerateArray ().All (e => e.ValueKind == JsonValueKind.String && Enum.TryParse<TraceCategory> (e.GetString (), true, out _));","typeGuard":"static bool IsValidTraceCategory (string value) => Enum.TryParse<TraceCategory> (value, true, out _);","tryCatchPattern":"ConfigurationManager.ThrowOnJsonErrors = false;","preventionTips":["Spell-check each TraceCategory name against the enum definition.","Drop unknown names rather than leaving them in config.","Regenerate config snippets from the enum to avoid stale names after upgrades."],"tags":["config","json","tracing","tracecategory","enum"],"backgroundTag":null,"analyzedSha":"2e47b11478db083499917f2ad27c34d30efb0df1","analyzedAt":"2026-08-13T19:20:08.826Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}