Skip to main content

opendev_repl/
error.rs

1//! Error types for the REPL crate.
2
3/// Errors that can occur in the REPL.
4#[derive(Debug, thiserror::Error)]
5pub enum ReplError {
6    /// I/O error (reading input, writing output).
7    #[error("I/O error: {0}")]
8    Io(#[from] std::io::Error),
9
10    /// Agent error during query processing.
11    #[error("Agent error: {0}")]
12    Agent(#[from] opendev_agents::AgentError),
13
14    /// Tool execution error.
15    #[error("Tool error: {0}")]
16    Tool(#[from] opendev_tools_core::ToolError),
17
18    /// Session error.
19    #[error("Session error: {0}")]
20    Session(String),
21
22    /// Command not found.
23    #[error("Unknown command: {0}")]
24    UnknownCommand(String),
25
26    /// User interrupted (Ctrl+C).
27    #[error("Interrupted")]
28    Interrupted,
29
30    /// End of input (Ctrl+D / EOF).
31    #[error("End of input")]
32    Eof,
33
34    /// Generic error.
35    #[error("{0}")]
36    Other(String),
37}