{"record":{"id":"908b589947678aa8","repo":"JosefNemec/Playnite","slug":"uknown-extension-type-options-type","errorCode":null,"errorMessage":"Uknown extension type {options.Type}.","messagePattern":"Uknown extension type (.+?)\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"source/Tools/Playnite.Toolbox/Program.cs","lineNumber":136,"sourceCode":"                        outPath = Themes.GenerateNewTheme(ApplicationMode.Desktop, options.Name);\r\n                        break;\r\n                    case ItemType.FullscreenTheme:\r\n                        outPath = Themes.GenerateNewTheme(ApplicationMode.Fullscreen, options.Name);\r\n                        break;\r\n                    case ItemType.PowerShellScript:\r\n                        outPath = Extensions.GenerateScriptExtension(options.Name, options.OutDirectory);\r\n                        break;\r\n                    case ItemType.GenericPlugin:\r\n                        outPath = Extensions.GeneratePluginExtension(ExtensionType.GenericPlugin, options.Name, options.OutDirectory);\r\n                        break;\r\n                    case ItemType.MetadataPlugin:\r\n                        outPath = Extensions.GeneratePluginExtension(ExtensionType.MetadataProvider, options.Name, options.OutDirectory);\r\n                        break;\r\n                    case ItemType.LibraryPlugin:\r\n                        outPath = Extensions.GeneratePluginExtension(ExtensionType.GameLibrary, options.Name, options.OutDirectory);\r\n                        break;\r\n                    default:\r\n                        throw new NotSupportedException($\"Uknown extension type {options.Type}.\");\r\n                }\r\n\r\n                logger.Info($\"Created new {options.Type} in \\\"{outPath}\\\"\");\r\n                logger.Warn($\"Don't forget to update manifest file with relevant information.\");\r\n                if (options.Type == ItemType.GenericPlugin || options.Type == ItemType.LibraryPlugin || options.Type == ItemType.MetadataPlugin)\r\n                {\r\n                    logger.Warn($\"Use generated .sln solution file to open plugin source.\");\r\n                }\r\n            }\r\n            catch (Exception e) when (!Debugger.IsAttached)\r\n            {\r\n                AppResult = 1;\r\n                logger.Error(e, $\"Failed to create new {options.Type}.\" + Environment.NewLine + e.Message);\r\n            }\r\n        }\r\n\r\n        public static void ProcessPackOptions(PackCmdLineOptions options)\r\n        {\r","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/JosefNemec/Playnite/blob/5911f4e964e628aa7a69c2030ab35101afa63067/source/Tools/Playnite.Toolbox/Program.cs#L118-L154","documentation":"Thrown by the `new` verb's switch in Program.cs when options.Type does not match any handled ItemType case. The default branch raises NotSupportedException. Note the ItemType enum's first member is `Uknown` (value 0), which is also the parser default — so an unrecognized or empty type argument parses to Uknown and falls through to default.","triggerScenarios":"Running `Toolbox new <type>` where <type> is not one of: DesktopTheme, FullscreenTheme, PowerShellScript, GenericPlugin, MetadataPlugin, LibraryPlugin. Also triggered by passing no type (defaults to ItemType.Uknown) or a typo such as `generic-plugin` vs `GenericPlugin`.","commonSituations":"Case mismatch (CommandLine parsing of the enum is case-sensitive); using a hyphenated form; copying a verb name from outdated docs; passing `help` or `list` expecting it to enumerate types.","solutions":["Use one of the exact enum names: `Toolbox new GenericPlugin MyPlugin` (PascalCase, no spaces, no hyphens).","If unsure of valid types, pass an intentionally invalid type and read the exception, or consult the ItemType enum in CmdLineOptions.cs.","For library/metadata plugins use `LibraryPlugin` / `MetadataPlugin` respectively — these map to GameLibrary/MetadataProvider ExtensionTypes internally.","Avoid the value `Uknown` — it is the sentinel default and is intentionally not handled."],"exampleFix":"// before\n//   Toolbox new generic-plugin MyPlugin   -> NotSupportedException\n\n// after\n//   Toolbox new GenericPlugin MyPlugin","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"static bool IsSupportedItemType(ItemType t) =>\n    t == ItemType.DesktopTheme || t == ItemType.FullscreenTheme ||\n    t == ItemType.PowerShellScript || t == ItemType.GenericPlugin ||\n    t == ItemType.MetadataPlugin || t == ItemType.LibraryPlugin;\n\n// before the switch:\nif (!IsSupportedItemType(options.Type))\n    throw new ArgumentException($\"Unsupported/unknown add-on type: {options.Type}\");","tryCatchPattern":null,"preventionTips":["Drive `new` from a fixed list of the six valid ItemType names rather than free-text input.","Reject ItemType.Uknown (the parser default) explicitly before dispatching.","Print the accepted type list in the CLI help text to prevent typos."],"tags":["toolbox","cli","enum","argument-parsing","precondition"],"backgroundTag":null,"analyzedSha":"5911f4e964e628aa7a69c2030ab35101afa63067","analyzedAt":"2026-08-13T17:38:25.713Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}