config/errors/
config_error_cause.rs

1use git::errors::GitError;
2use thiserror::Error;
3
4use crate::errors::InvalidColorError;
5
6/// The kind of config error that occurred.
7#[derive(Error, Debug, PartialEq)]
8#[non_exhaustive]
9#[allow(variant_size_differences)]
10pub enum ConfigErrorCause {
11	/// The input provided is not a valid color
12	#[error(transparent)]
13	InvalidColor(InvalidColorError),
14	/// An error occurred reading the git config files.
15	#[error(transparent)]
16	GitError(GitError),
17	/// The input provided is not a valid value for the show whitespace value.
18	#[error("Must match one of 'true', 'on', 'both', 'trailing', 'leading', 'false', 'off' or 'none'.")]
19	InvalidShowWhitespace,
20	/// The input provided is not a valid value for the ignore whitespace value.
21	#[error("Must match one of 'true', 'on', 'all', 'change', 'false', 'off' or 'none'")]
22	InvalidDiffIgnoreWhitespace,
23	/// The input provided is not a valid value for the diff renames.
24	#[error("Must match one of 'true', 'false', 'copy', or 'copies'")]
25	InvalidDiffRenames,
26	/// The input provided is not a valid boolean value.
27	#[error("The input provided is not a valid boolean value")]
28	InvalidBoolean,
29	/// The input provided is outside of valid range for an unsigned 32-bit integer.
30	#[error("The input provided is outside of valid range for an unsigned 32-bit integer")]
31	InvalidUnsignedInteger,
32	/// The input provided is not a valid input keybinding.
33	#[error("The input provided is not a valid input keybinding.")]
34	InvalidKeyBinding,
35	/// The input provided is not valid UTF.
36	#[error("The input provided is not valid UTF")]
37	InvalidUtf,
38	/// The input provided resulted in an unknown error variant: {0}.
39	#[error("The input provided resulted in an unknown error variant")]
40	UnknownError(String),
41}