{"record":{"id":"003efef6e9472595","repo":"tui-cs/Terminal.Gui","slug":"propertyname-property-ex-message","errorCode":null,"errorMessage":"{propertyName}: \"{property}\" - {ex.Message}","messagePattern":"(.+?): \"(.+?)\" - (.+?)","errorType":"exception","errorClass":"JsonException","httpStatus":null,"severity":"error","filePath":"Terminal.Gui/Configuration/AttributeJsonConverter.cs","lineNumber":104,"sourceCode":"\n                        try\n                        {\n                            style = Enum.Parse<TextStyle> (reader.GetString ()!, ignoreCase: true);\n                        }\n                        catch (ArgumentException ex)\n                        {\n                            throw new JsonException (\"Expected a valid text style value.\", ex);\n                        }\n\n                        break;\n\n                    default:\n                        throw new JsonException ($\"{propertyName}: Unknown Attribute property .\");\n                }\n            }\n            catch (JsonException ex)\n            {\n                throw new JsonException ($\"{propertyName}: \\\"{property}\\\" - {ex.Message}\");\n            }\n        }\n\n        throw new JsonException ($\"{propertyName}: Bad Attribute.\");\n    }\n\n    public override void Write (Utf8JsonWriter writer, Attribute value, JsonSerializerOptions options)\n    {\n        writer.WriteStartObject ();\n        writer.WritePropertyName (nameof (Attribute.Foreground));\n        ColorJsonConverter.Instance.Write (writer, value.Foreground, options);\n        writer.WritePropertyName (nameof (Attribute.Background));\n        ColorJsonConverter.Instance.Write (writer, value.Background, options);\n        if (value.Style != TextStyle.None)\n        {\n            writer.WritePropertyName (nameof (Attribute.Style));\n            writer.WriteStringValue (value.Style.ToString ());\n        }","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/tui-cs/Terminal.Gui/blob/2e47b11478db083499917f2ad27c34d30efb0df1/Terminal.Gui/Configuration/AttributeJsonConverter.cs#L86-L122","documentation":"Wrapper: the outer catch in AttributeJsonConverter.Read re-throws any JsonException raised inside the property switch, prepending the current propertyName and the just-read property value/ token descriptor. It is not a standalone condition — it always wraps one of errors 21/22/23 (or a nested Color deserialize failure). Read the trailing \"- {ex.Message}\" for the real cause.","triggerScenarios":"Any of errors 21, 22, 23 firing, or JsonSerializer.Deserialize of the Color value throwing. The message format is `'{propertyName}: \"{property}\" - {inner}'`.","commonSituations":"Same as the underlying error; this wrapper just adds context (which property and what value was seen). Treat the suffix after the dash as the real diagnostic.","solutions":["Read the substring after \" - \" to identify the underlying cause (Expected a string value / valid text style / Unknown property / Color error).","Apply the fix for the underlying error (21, 22, 23, or 26/27).","Re-validate the whole Attribute object against the three known keys."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { ConfigurationManager.Apply (); }\ncatch (JsonException ex)\n{\n    // ex.Message shape: 'propertyName: \"value\" - <inner>'. Parse the suffix after ' - '.\n    string inner = ex.Message.Substring (ex.Message.IndexOf (\" - \") + 3);\n    LogConfigError (inner); // then route to the fix for the underlying error 21/22/23/26/27\n}","preventionTips":["Treat the suffix after ' - ' as the real cause when triaging Attribute errors.","Validate foreground/background/style before loading to avoid reaching this wrapper."],"tags":["configuration","json","theming","attribute","wrapper"],"backgroundTag":null,"analyzedSha":"2e47b11478db083499917f2ad27c34d30efb0df1","analyzedAt":"2026-08-13T19:20:08.826Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}