pub enum ConfigError {
InvalidTimeout,
InvalidEndpoint {
reason: String,
},
InvalidModel {
reason: &'static str,
},
FrontierModel {
model: String,
},
KeyFile {
reason: String,
},
KeyFileIgnored {
reason: KeyFileIgnoredReason,
},
}Expand description
Why the LLM configuration is unusable.
Neither Display nor Debug carries a variable’s value or the key-file
path: a key pasted into the wrong variable must not reach a log. Each
message names the variable and the rule it breaks.
Variants§
InvalidTimeout
CPM_LLM_TIMEOUT_SECS is not an integer in 1..=300. The value is not
kept.
InvalidEndpoint
CPM_JEV_ENDPOINT is not an acceptable URL. The value itself is not
echoed (it may carry credentials).
InvalidModel
CPM_JEV_MODEL is not a plausible model id (at most
MAX_MODEL_ID_CHARS chars of [A-Za-z0-9._:/-]), or it contains
the configured key. The value is not kept.
FrontierModel
CPM_LLM_MODEL names a frontier vendor this build refuses in favour
of a commodity model. The id is kept: it already passed the model-id
and key checks in parse_model.
KeyFile
CPM_OPENROUTER_KEY_FILE names something that cannot be used as a
key file (missing, unreadable, not a regular file, too large). The
path is not kept.
KeyFileIgnored
The key file was read but deliberately ignored. Distinct from “no key configured” so callers can say why. The path is not kept.
Fields
reason: KeyFileIgnoredReasonImplementations§
Source§impl ConfigError
impl ConfigError
Sourcepub fn review_reason(&self) -> String
pub fn review_reason(&self) -> String
A short plan.review review_unavailable reason naming the setting.
It carries neither the key nor any path or raw value (only the
variable name and the validation reason).
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()