use everruns_core::error::AgentLoopError;
#[derive(Debug, thiserror::Error)]
pub enum LocalError {
#[error("sqlite error: {0}")]
Sqlite(#[from] rusqlite::Error),
#[error("serialization error: {0}")]
Serde(#[from] serde_json::Error),
#[error("configuration error: {0}")]
Config(String),
#[error("{0}")]
Other(String),
}
pub type LocalResult<T> = std::result::Result<T, LocalError>;
impl From<LocalError> for AgentLoopError {
fn from(err: LocalError) -> Self {
match err {
LocalError::Config(msg) => AgentLoopError::config(msg),
other => AgentLoopError::store(other.to_string()),
}
}
}