#[non_exhaustive]pub enum ConfigError {
Show 18 variants
DuplicateContentFile {
file: String,
config_path: PathBuf,
line: Option<usize>,
},
DuplicateArchiveFile {
file: String,
config_path: PathBuf,
line: Option<usize>,
},
CannotAddContentFile {
file: String,
config_path: PathBuf,
},
CannotAddArchiveFile {
file: String,
config_path: PathBuf,
},
DuplicateGroundcoverFile {
file: String,
config_path: PathBuf,
line: Option<usize>,
},
CannotAddGroundcoverFile {
file: String,
config_path: PathBuf,
},
InvalidGameSetting {
value: String,
config_path: PathBuf,
line: Option<usize>,
},
BadEncoding {
value: String,
config_path: PathBuf,
line: Option<usize>,
},
InvalidLine {
value: String,
config_path: PathBuf,
line: Option<usize>,
},
Io(Error),
NotFileOrDirectory(PathBuf),
CannotFind(PathBuf),
CannotFindRootConfig {
local: PathBuf,
global: PathBuf,
},
CannotFindAnyConfig {
local: PathBuf,
global: PathBuf,
user: PathBuf,
},
NotWritable(PathBuf),
SubconfigNotLoaded(PathBuf),
MaxDepthExceeded(PathBuf),
PlatformPathUnavailable(&'static str),
}Expand description
Errors that can arise while loading, mutating, or saving an OpenMW configuration.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DuplicateContentFile
A content file (content=) appeared twice in the configuration chain.
DuplicateArchiveFile
A fallback-archive (fallback-archive=) appeared twice in the configuration chain.
CannotAddContentFile
OpenMWConfiguration::add_content_file
was called for a file that is already present.
CannotAddArchiveFile
OpenMWConfiguration::add_archive_file
was called for an archive that is already present.
DuplicateGroundcoverFile
A groundcover file (groundcover=) appeared twice in the configuration chain.
CannotAddGroundcoverFile
OpenMWConfiguration::add_groundcover_file
was called for a file that is already present.
InvalidGameSetting
A fallback= entry could not be parsed as a valid Key,Value pair.
BadEncoding
An encoding= entry contained an unrecognised encoding name.
Only win1250, win1251, and win1252 are valid.
InvalidLine
A line in an openmw.cfg file did not match any recognised key=value format.
Io(Error)
An I/O error occurred while reading or writing a config file.
NotFileOrDirectory(PathBuf)
The supplied path could not be classified as a file or directory.
CannotFind(PathBuf)
No openmw.cfg was found at the given path.
CannotFindRootConfig
Root config discovery tried both local and global config candidates and found neither.
global is empty on platforms without a global config directory (Windows, macOS).
CannotFindAnyConfig
External-tool config discovery found neither root nor user config candidates. global is
empty on platforms without a global config directory (Windows, macOS).
NotWritable(PathBuf)
The target path for a save operation is not writable.
SubconfigNotLoaded(PathBuf)
OpenMWConfiguration::save_subconfig
was called with a path that is not part of the loaded configuration chain.
MaxDepthExceeded(PathBuf)
The config= chain nests more than 16 levels below the root. A chain that loops does not
get here: a directory the chain already tried is skipped, as OpenMW skips it.
A platform default path could not be determined, because the environment or the
operating system gave none: HOME unset or empty, no Documents known folder, or a
platform OpenMW has no such path on. The string names the path: home, documents,
config, userdata, local, global or global_config.
Trait Implementations§
Source§impl Debug for ConfigError
impl Debug for ConfigError
Source§impl Display for ConfigError
impl Display for ConfigError
Source§impl Error for ConfigError
impl Error for ConfigError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()