#[non_exhaustive]pub enum ConfigError {
Show 18 variants
BadConfigLine {
location: String,
line: usize,
},
BadConfigLineInFile {
file: String,
line: usize,
},
MissingValue {
key: String,
},
BadConfigVariable {
key: String,
file: String,
line: usize,
},
KeyNotSet {
key: String,
},
BadNumericValue {
key: String,
value: String,
reason: BadNumericSource,
},
BadNumericValueInFile {
key: String,
value: String,
file: String,
reason: BadNumericSource,
},
BadConfigVariableAtLine {
key: String,
file: String,
line: usize,
},
UnableToParseFromCommandLine {
key: String,
},
RemoteUrlInHasconfigInclude,
IncludeDepthExceeded {
depth: usize,
limit: usize,
},
Other(String),
ConfigFileLocked {
path: String,
},
MultipleValues {
key: String,
},
WorktreeConfigNotEnabled,
SectionNotFound {
section: String,
},
MultilineCommentNotAllowed,
InvalidUntrackedFilesMode {
value: String,
},
}Expand description
Configuration parse and validation failures.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BadConfigLine
A line in a config file could not be parsed.
Fields
BadConfigLineInFile
Same as Self::BadConfigLine with an explicit file path (Git file diagnostics).
Fields
MissingValue
A config key requires a value but none was given.
BadConfigVariable
fetch.negotiationalgorithm and similar keys with missing values.
Fields
KeyNotSet
unset or a scoped read/write was requested for a key that is not set in that file.
BadNumericValue
Integer config value could not be parsed or is out of range.
Fields
reason: BadNumericSourceWhy the value or operation was rejected.
BadNumericValueInFile
Same as Self::BadNumericValue with file context.
Fields
reason: BadNumericSourceWhy the value or operation was rejected.
BadConfigVariableAtLine
diff.context (or similar) failed variable validation.
Fields
UnableToParseFromCommandLine
Command-line config could not supply a parseable value for a key.
RemoteUrlInHasconfigInclude
includeIf.hasconfig:remote.*.url cannot pull remote URLs from included files.
IncludeDepthExceeded
[include] / [includeIf] nesting exceeded the Git-compatible depth limit.
Fields
Other(String)
Generic config error with free-form detail (legacy call sites).
ConfigFileLocked
The config file could not be written because a .lock file is already present.
MultipleValues
A single-value operation was requested but the key has multiple values.
WorktreeConfigNotEnabled
Per-worktree config was requested but extensions.worktreeConfig is off.
SectionNotFound
remove-section or rename-section did not find the named section.
MultilineCommentNotAllowed
Inline --comment text must not span lines.
InvalidUntrackedFilesMode
status.showUntrackedFiles must be no, normal, all, or a Git boolean synonym.
Implementations§
Source§impl ConfigError
impl ConfigError
Sourcepub fn message_body(&self) -> String
pub fn message_body(&self) -> String
Git stderr body for this error (without a fatal: prefix).
Trait Implementations§
Source§impl Clone for ConfigError
impl Clone for ConfigError
Source§impl Debug for ConfigError
impl Debug for ConfigError
Source§impl Display for ConfigError
impl Display for ConfigError
impl Eq for ConfigError
Source§impl Error for ConfigError
impl Error for ConfigError
1.30.0 · 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()