Skip to main content

ao_core/
error.rs

1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, AoError>;
4
5#[derive(Debug, Error)]
6pub enum AoError {
7    #[error("session not found: {0}")]
8    SessionNotFound(String),
9
10    #[error("runtime error: {0}")]
11    Runtime(String),
12
13    #[error("workspace error: {0}")]
14    Workspace(String),
15
16    #[error("agent error: {0}")]
17    Agent(String),
18
19    #[error("scm error: {0}")]
20    Scm(String),
21
22    #[error("io: {0}")]
23    Io(#[from] std::io::Error),
24
25    #[error("yaml: {0}")]
26    Yaml(String),
27
28    #[error("config: {0}")]
29    Config(String),
30
31    #[error("unresolved orchestrator prompt placeholder: {{{{{key}}}}}")]
32    PromptTemplate { key: String },
33
34    #[error("{0}")]
35    Other(String),
36}