use thiserror::Error;
#[derive(Error, Debug)]
pub enum BriefError {
#[error("source `{source_id}` failed: {message}")]
Source {
source_id: String,
message: String,
},
#[error("brief rejected by governance: {0}")]
Rejected(String),
#[error("token budget unsatisfiable: needed at least {needed}, had {available}")]
BudgetUnsatisfiable {
needed: usize,
available: usize,
},
#[error("source `{source_id}` timed out after {timeout_ms}ms")]
Timeout {
source_id: String,
timeout_ms: u64,
},
}
pub type Result<T> = std::result::Result<T, BriefError>;