Skip to main content

aether_evals/
error.rs

1use crate::agents::RunError;
2use crate::git_repo::GitRepoError;
3use std::path::PathBuf;
4use thiserror::Error;
5
6#[derive(Debug, Error)]
7pub enum WorkspaceError {
8    #[error("failed to create temporary directory: {0}")]
9    CreateTempDir(#[source] std::io::Error),
10
11    #[error("failed to copy fixture directory from '{}' to '{}': {source}", from.display(), to.display())]
12    CopyFixture {
13        from: PathBuf,
14        to: PathBuf,
15        #[source]
16        source: std::io::Error,
17    },
18
19    #[error("failed to write workspace file '{}': {source}", path.display())]
20    WriteFile {
21        path: PathBuf,
22        #[source]
23        source: std::io::Error,
24    },
25
26    #[error("git workspace setup failed: {0}")]
27    Git(#[from] GitRepoError),
28
29    #[error("git workspace subdirectory does not exist: {}", path.display())]
30    MissingSubdir { path: PathBuf },
31}
32
33#[derive(Debug, Error)]
34pub enum EvalRunError {
35    #[error("agent run failed: {0}")]
36    Agent(#[from] RunError),
37
38    #[error("workspace error: {0}")]
39    Workspace(#[from] WorkspaceError),
40}