pub enum Error {
RegionNotFound(String),
ValidationFailed(String),
TokenBudgetExceeded {
used: usize,
max: usize,
},
RegionFull {
region: String,
used: usize,
max: usize,
},
RegionRefusedWrite {
region: String,
reason: String,
},
PinnedRegionsOverBudget {
pinned_tokens: usize,
total_budget: usize,
},
BlueprintInvalid(String),
LayoutInvalid(String),
TransformFailed(String),
SerializationError(Error),
Other(String),
}Expand description
Core error types for Leviath.
Variants§
RegionNotFound(String)
Region with the specified name was not found
ValidationFailed(String)
Region validation failed
TokenBudgetExceeded
Content exceeds region’s token budget
Fields
RegionFull
A region under admission = "reject" is full, and the write was
refused rather than something else being dropped to fit it.
Distinct from Error::TokenBudgetExceeded because the remedy is
different: that one says this single write is too big for the region,
this one says the region is full and the agent has to decide what it is
finished with.
Fields
RegionRefusedWrite
A custom region’s on_write hook rejected the write.
Only raised for agent-origin writes (context_write, context_append,
routed tool results), where the refusal and its reason can be reported
back to the writer. A framework write that a hook rejects is stored
unchanged with a warning instead - a script must not be able to delete
an assistant turn or a system record.
Fields
PinnedRegionsOverBudget
Pinned regions alone exceed total token budget
Fields
BlueprintInvalid(String)
Blueprint validation failed
LayoutInvalid(String)
Layout validation failed
TransformFailed(String)
Context transform failed
SerializationError(Error)
Serialization error
Other(String)
Generic error
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()