pub enum Error {
Config(String),
Io {
path: PathBuf,
source: Error,
},
Parse {
path: PathBuf,
message: String,
},
Provider(ProviderFailure),
Session(String),
MaxIterations(usize),
Cancelled,
Stopped(String),
Vision(String),
AwaitingApproval(Waiting),
Unparsed {
error: String,
reply: String,
},
}Variants§
Config(String)
Io
Parse
Provider(ProviderFailure)
Session(String)
MaxIterations(usize)
Cancelled
Stopped(String)
A hook ended the run. Distinct from cancellation because nobody pressed anything: the reason is the point, and a caller that retries a cancelled run should not retry this.
Vision(String)
The turn was not started because it could not carry its pictures (#346). The sentence is
the refusal itself — what cannot be done and what to change — because every surface prints
it as it is, and two surfaces wording it differently is how a bug gets reported twice.
AwaitingApproval(Waiting)
The run stopped on an approval nobody has answered: the calls are recorded, the turn is not, and any later process can answer them. Not a cancellation — nothing was stopped on purpose — and not a denial, which would be a decision made on the user’s behalf.
Unparsed
The model answered, and the answer was not the shape the caller asked for — twice: once as it came, and once after a retry that carried the parse error back to it. The reply is kept because the failure is about what it wrote, and a caller that only gets “invalid JSON” has to re-run the whole thing to find out what.
Implementations§
Source§impl Error
impl Error
pub fn io(path: impl Into<PathBuf>, source: Error) -> Self
Sourcepub fn provider(message: impl Into<String>) -> Self
pub fn provider(message: impl Into<String>) -> Self
A provider failure with nothing but an explanation, for call sites that have no more structure to offer than a message.
Sourcepub fn provider_failure(&self) -> Option<&ProviderFailure>
pub fn provider_failure(&self) -> Option<&ProviderFailure>
The provider failure inside this error, when it is one. A caller that cares about the status or the retry policy asks here instead of matching the variant itself.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl From<Error> for Error
A database failure is a failure to store a session — the one thing the caller was
trying to do — so it reports as a session error rather than a new variant callers would
have to match on.
impl From<Error> for Error
A database failure is a failure to store a session — the one thing the caller was trying to do — so it reports as a session error rather than a new variant callers would have to match on.