#[non_exhaustive]pub enum CredentialsError {
Io {
path: String,
source: Error,
},
Parse {
path: String,
line: usize,
column: usize,
message: String,
},
}Expand description
Why credentials.toml could not be read.
Exists so doiget config doctor can report the failure. Without it
the only surface was tracing::warn!, which the CLI’s
EnvFilter::from_default_env() suppresses at the default level — so a
malformed or unreadable credentials file produced no warning, no doctor
line, and only the downstream “source unavailable” this module exists to
prevent.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io
The file exists but could not be read.
Parse
The file is not valid TOML.
Deliberately not carrying the toml::de::Error. Its Display
renders the offending source line verbatim, and the commonest way
this file is malformed is an unterminated api_key = "..." — so the
error most likely to be printed is the one whose snippet is the
key. Its Debug is worse: it holds the whole file. config doctor
prints this variant, so it gets the position and the parser’s
message and nothing off the line itself.
Trait Implementations§
Source§impl Debug for CredentialsError
impl Debug for CredentialsError
Source§impl Display for CredentialsError
impl Display for CredentialsError
Source§impl Error for CredentialsError
impl Error for CredentialsError
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()