pub enum ConfigError {
Show 22 variants
Io(PathBuf, Error),
Parse(PathBuf, String),
EnvVarUnset(String, String),
EnvVarNotUnicode(String, String),
Temperature {
index: usize,
temperature: f32,
},
ZeroConcurrency {
index: usize,
},
ZeroTimeout {
index: usize,
},
ZeroMaxTokens {
index: usize,
},
ZeroReviewRounds,
UnknownProtocol {
index: usize,
value: String,
},
UnusableHeaderName {
index: usize,
name: String,
},
UnusableHeaderValue {
index: usize,
name: String,
},
DuplicateHeaderName {
index: usize,
first: String,
second: String,
},
UnknownBackend {
index: usize,
value: String,
},
UnknownReasoningEffort {
index: usize,
value: String,
},
AmbiguousApiKey {
index: usize,
},
EmptyApiKeyCommand {
index: usize,
},
BackendField {
index: usize,
backend: &'static str,
field: &'static str,
},
BackendMissingField {
index: usize,
backend: &'static str,
field: &'static str,
},
NoProviders(PathBuf),
NoEnabledProviders(PathBuf),
SiteOnlyField {
path: PathBuf,
field: &'static str,
},
}Expand description
What went wrong reading or validating the configuration.
Variants§
Io(PathBuf, Error)
Parse(PathBuf, String)
EnvVarUnset(String, String)
EnvVarNotUnicode(String, String)
Temperature
The index is the zero-based position in the file; the message renders
it one-based, and says “in file order” because the chain numbers only
the enabled entries - with a disabled head the two differ, and
[[llm]] #1 meaning different tables in the same file is worse than
either convention alone.
ZeroConcurrency
max_concurrent = 0 builds a semaphore with no permits, so every
request waits for one forever. Rejected at load rather than clamped: a
silent bump to 1 would run a gate at a concurrency the user did not ask
for, and the alternative - the documented “callers are expected to set a
positive value” - is a hang with no message at all.
ZeroTimeout
ZeroMaxTokens
ZeroReviewRounds
UnknownProtocol
Rejected rather than defaulted: falling back to openai would post
chat-completions bytes to a /messages endpoint, and the resulting 404
reads as “the provider is down” rather than “this line has a typo”.
UnusableHeaderName
UnusableHeaderValue
Names the header, never its value: the value is the half that carries a
tenant or project token, and an error message is the one place it would
escape into a terminal, a CI log or a bug report. The rule
KeyCommandError already follows for a credential helper’s output.
DuplicateHeaderName
Both spellings, never either value: which of the two is the credential is
exactly what this error cannot know, so it quotes neither, the way
UnusableHeaderValue above quotes none.
UnknownBackend
UnknownReasoningEffort
AmbiguousApiKey
Both credential fields answer the same question, so a file setting both has said two things. Rejected rather than resolved by precedence: the user who wrote the command wrote it to be run, and a silent “the literal wins” leaves them debugging a stale credential the file says nothing about.
EmptyApiKeyCommand
An argv with no first element names no program. Rejected at load because the alternative is discovering it inside the gate, at the point where there is nothing to run and nothing useful to say about why.
BackendField
BackendMissingField
NoProviders(PathBuf)
NoEnabledProviders(PathBuf)
SiteOnlyField
Rejected rather than ignored, which is the one behaviour that would be
worse than either: serde drops an unknown key without a word, so a
developer reads refuse_markers in their own config, believes the
repository is protected, and every review still ships its source. It is
refused here rather than honoured because drep init gitignores this
file - a copy of the control would be per-developer, and a refusal a
developer can delete is not one.
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
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()