1use acp_utils::client::AcpClientError;
2use thiserror::Error;
3
4#[derive(Debug, Error)]
6pub enum AppError {
7 #[error(
8 "ACP connection lost. The agent may still be running. No prompts were retried; reconnect and inspect the session before resubmitting"
9 )]
10 ConnectionLost,
11 #[error("Server did not advertise the Aether remote-server contract; connect to `aether server`")]
12 MissingRemoteContract,
13 #[error("I/O error: {0}")]
14 Io(#[from] std::io::Error),
15 #[error("{0}")]
16 Acp(#[from] AcpClientError),
17 #[error(transparent)]
18 Render(#[from] RenderError<std::io::Error>),
19}
20
21#[derive(Debug, Error)]
23pub enum RenderError<E> {
24 #[error("terminal rendering failed: {0}")]
25 Backend(#[source] E),
26 #[error("streaming markdown layout failed: {0}")]
27 MarkdownStream(#[from] clankerdiff_ratatui::MarkdownStreamError),
28 #[error("streaming markdown history commit failed: {0}")]
29 MarkdownCommit(#[from] clankerdiff_ratatui::MarkdownCommitError),
30}