{"record":{"id":"fdd6ee7d7ef0a042","repo":"AvaloniaUI/Avalonia","slug":"unsupported-command","errorCode":null,"errorMessage":"Unsupported command","messagePattern":"Unsupported command","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/Avalonia.Base/Media/PathMarkupParser.cs","lineNumber":161,"sourceCode":"                            AddCubicBezierCurve(ref span, relative);\n                            break;\n                        case Command.QuadraticBezierCurve:\n                            AddQuadraticBezierCurve(ref span, relative);\n                            break;\n                        case Command.SmoothCubicBezierCurve:\n                            AddSmoothCubicBezierCurve(ref span, relative);\n                            break;\n                        case Command.SmoothQuadraticBezierCurve:\n                            AddSmoothQuadraticBezierCurve(ref span, relative);\n                            break;\n                        case Command.Arc:\n                            AddArc(ref span, relative);\n                            break;\n                        case Command.Close:\n                            CloseFigure();\n                            break;\n                        default:\n                            throw new NotSupportedException(\"Unsupported command\");\n                    }\n\n                    initialCommand = false;\n                } while (PeekArgument(span));\n                \n            }\n\n            if (_isOpen)\n            {\n                _geometryContext.EndFigure(false);\n            }\n        }\n\n        private void CreateFigure()\n        {\n            ThrowIfDisposed();\n\n            if (_isOpen)","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/Media/PathMarkupParser.cs#L143-L179","documentation":"A defensive throw in the default branch of the command-dispatch switch inside Parse(). ReadCommand only ever returns Command values that exist in the s_commands lookup table (F,M,L,H,V,Q,T,C,S,A,Z), so every enum value the switch sees is already covered by an explicit case. This default is effectively unreachable for real input; it exists to keep the switch exhaustive and to fail loudly if the Command enum gains a member that is never wired into the switch.","triggerScenarios":"Not triggerable through any path markup string. Would only fire if a developer added a new Command enum value and a corresponding s_commands entry but forgot to add a case in Parse().","commonSituations":"Internal contributors extending the path command set. End users hitting this should suspect a corrupted/custom build rather than bad data.","solutions":["If you extended the Command enum, add the matching case in the Parse() switch (line ~123).","Do not chase this as a data error — your path string is not the cause.","Add a unit test covering any new command so the switch stays exhaustive."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { parser.Parse(data); }\ncatch (NotSupportedException) { /* internal/defensive: report a library bug, not bad input */ }","preventionTips":["This branch is unreachable for valid input — if you hit it, suspect a modified library build.","When extending the Command enum, update the Parse() switch and add a test in the same change."],"tags":["avalonia","path-markup","defensive","unreachable","switch"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}