{"record":{"id":"8792e2a871d833ab","repo":"SubtitleEdit/subtitleedit","slug":"settings-file-not-found-path","errorCode":null,"errorMessage":"Settings file not found: {path}","messagePattern":"Settings file not found: (.+?)","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"src/seconv/Core/SeConvSettings.cs","lineNumber":46,"sourceCode":"    [JsonPropertyName(\"profiles\")]\n    public Dictionary<string, SeConvSettings>? Profiles { get; set; }\n\n    [JsonExtensionData]\n    public Dictionary<string, JsonElement>? UnknownMembers { get; set; }\n\n    private static readonly JsonSerializerOptions JsonOptions = new()\n    {\n        PropertyNamingPolicy = JsonNamingPolicy.CamelCase,\n        PropertyNameCaseInsensitive = true,\n        ReadCommentHandling = JsonCommentHandling.Skip,\n        AllowTrailingCommas = true,\n    };\n\n    public static SeConvSettings Load(string path)\n    {\n        if (!File.Exists(path))\n        {\n            throw new FileNotFoundException($\"Settings file not found: {path}\", path);\n        }\n\n        using var stream = File.OpenRead(path);\n        return JsonSerializer.Deserialize<SeConvSettings>(stream, JsonOptions)\n            ?? throw new InvalidDataException($\"Settings file is empty or null: {path}\");\n    }\n\n    /// <summary>\n    /// Serializes a complete settings file populated with the current libse defaults —\n    /// every key seconv understands, with its correct (camelCase) name and default value.\n    /// Backs <c>seconv dump-settings</c>, which users redirect to a file as a starting point\n    /// (issue #11037): it teaches the schema, so no one has to guess that the key is\n    /// <c>removeIfAllUppercase</c> and not the GUI's <c>IsRemoveTextUppercaseLineOn</c>.\n    /// <para>Built by mirroring <see cref=\"Configuration.Settings\"/> (the same source\n    /// <see cref=\"ApplyBaseSections\"/> writes back into) and a fresh <see cref=\"ImageExportStyle\"/>,\n    /// so the output round-trips through <see cref=\"Load\"/> with zero unknown keys — the dump\n    /// can never drift from what the loader accepts.</para>\n    /// </summary>","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/seconv/Core/SeConvSettings.cs#L28-L64","documentation":"Thrown by SeConvSettings.Load when the settings file path passed to it does not exist (File.Exists returns false). FileNotFoundException includes the path as both the message and the FileName so the caller can see exactly what was missing. This is the entry point for `--settings <path>` and validates the file before attempting JSON parsing.","triggerScenarios":"Calling `SeConvSettings.Load(path)` (via `--settings=/path/to/settings.json`) where the path is wrong, relative to a different working directory, or the file was never created.","commonSituations":"Typoing the --settings path; relative path resolved against the wrong cwd; the file lives in a different user profile; a deploy step that copies settings was skipped.","solutions":["Pass an absolute path to --settings.","Generate a starting file with `seconv dump-settings > settings.json`.","Verify the path with `ls`/`Test-Path` before running seconv.","Check quoting in the shell — unquoted paths with spaces may be split."],"exampleFix":"# before\nseconv in.srt out.srt --settings=settings.json   # not in cwd\n# after\nseconv in.srt out.srt --settings=/home/user/seconv/settings.json","handlingStrategy":"validation","validationCode":"if (!File.Exists(path))\n    throw new ArgumentException(\"Settings file not found: \" + path);\nvar settings = SeConvSettings.Load(path);","typeGuard":"static bool SettingsFileExists(string? p) =>\n    !string.IsNullOrWhiteSpace(p) && File.Exists(p);","tryCatchPattern":"try { var s = SeConvSettings.Load(path); }\ncatch (FileNotFoundException ex) when (ex.FileName == path)\n{\n    // generate defaults, or abort with the missing path\n}","preventionTips":["Resolve --settings to an absolute path before loading.","Run `seconv dump-settings > settings.json` to bootstrap a valid file.","Verify with File.Exists in your startup checks."],"tags":["settings","json","file-not-found","configuration","cli"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}