{"record":{"id":"fc96f1f3ebb3c2d6","repo":"Devolutions/UniGetUI","slug":"the-bundle-format-format-is-not-supported","errorCode":null,"errorMessage":"The bundle format \"{format}\" is not supported.","messagePattern":"The bundle format \"(.+?)\" is not supported\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/UniGetUI.Interface.IpcApi/IpcBundleApi.cs","lineNumber":537,"sourceCode":"        return extension.ToLowerInvariant() switch\n        {\n            \".json\" => BundleFormatType.JSON,\n            \".ubundle\" or \"\" => BundleFormatType.UBUNDLE,\n            _ => throw new InvalidOperationException(\n                \"Bundle export only supports .ubundle and .json output files.\"\n            ),\n        };\n    }\n\n    private static BundleFormatType ParseFormat(string? format)\n    {\n        return format?.Trim().TrimStart('.').ToLowerInvariant() switch\n        {\n            null or \"\" or \"ubundle\" => BundleFormatType.UBUNDLE,\n            \"json\" => BundleFormatType.JSON,\n            \"yaml\" or \"yml\" => BundleFormatType.YAML,\n            \"xml\" => BundleFormatType.XML,\n            _ => throw new InvalidOperationException(\n                $\"The bundle format \\\"{format}\\\" is not supported.\"\n            ),\n        };\n    }\n\n    private static IpcPackageLookupMode ParseLookupMode(string? selection)\n    {\n        return selection?.Trim().ToLowerInvariant() switch\n        {\n            null or \"\" or \"search\" => IpcPackageLookupMode.Search,\n            \"installed\" => IpcPackageLookupMode.Installed,\n            \"updates\" or \"upgradable\" => IpcPackageLookupMode.Upgradable,\n            \"auto\" => IpcPackageLookupMode.Any,\n            _ => throw new InvalidOperationException(\n                $\"The bundle selection mode \\\"{selection}\\\" is not supported.\"\n            ),\n        };\n    }","sourceCodeStart":519,"sourceCodeEnd":555,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.Interface.IpcApi/IpcBundleApi.cs#L519-L555","documentation":"Thrown by IpcBundleApi.ParseFormat when an explicit format string (after trimming a leading dot and lowercasing) is not one of ubundle/json/yaml/yml/xml. ParseFormat is used for import format resolution, both from an explicit --format flag and from a file extension when no format is given.","triggerScenarios":"Calling bundle import with '--format toml', '--format csv', or a malformed value like '--format .ubundle2'. Also triggered when the import path's extension resolves to an unknown value AND no explicit Format is supplied on the request object (ResolveImportFormat falls back to ParseFormat(extension)).","commonSituations":"Typing a format name from memory (e.g. 'yml' works but 'yaml-file' does not). Passing a path with a non-bundle extension (e.g. .txt) and no --format override. Case is handled (lowercased) but leading-only-dot is stripped, so '..json' fails.","solutions":["Use one of the supported format tokens: ubundle, json, yaml, yml, or xml.","If importing by path, rely on the file extension instead of passing --format, or rename the file to a recognized extension.","Strip stray characters from the format value before sending (ParseFormat only trims one leading dot)."],"exampleFix":"// before\nunigetui bundle import --format toml --path set.txt\n// after\nunigetui bundle import --format json --path set.txt","handlingStrategy":"validation","validationCode":"static readonly HashSet<string> s_formats = new(StringComparer.OrdinalIgnoreCase)\n    { \"ubundle\", \"json\", \"yaml\", \"yml\", \"xml\" };\n\nstatic bool IsValidFormat(string? f) =>\n    string.IsNullOrWhiteSpace(f) || s_formats.Contains(f.Trim().TrimStart('.'));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the format token against the known set before sending the import request.","When importing by path, let the server infer from the extension rather than passing --format.","Document the supported set next to every CLI entry point that accepts --format."],"tags":["ipc","bundle","import","file-format","input-validation"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}