Skip to main content

toolpath_codex/
error.rs

1use std::path::PathBuf;
2use thiserror::Error;
3
4pub type Result<T> = std::result::Result<T, ConvoError>;
5
6#[derive(Debug, Error)]
7pub enum ConvoError {
8    #[error("IO error: {0}")]
9    Io(#[from] std::io::Error),
10
11    #[error("JSON parsing error: {0}")]
12    Json(#[from] serde_json::Error),
13
14    #[error("Home directory not found")]
15    NoHomeDirectory,
16
17    #[error("Codex directory not found at path: {0}")]
18    CodexDirectoryNotFound(PathBuf),
19
20    #[error("Session not found: {0}")]
21    SessionNotFound(String),
22
23    #[error("Invalid session file format: {0}")]
24    InvalidFormat(PathBuf),
25
26    #[error("Generic error: {0}")]
27    Other(#[from] anyhow::Error),
28}