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 #[error("git bundle file does not exist: {}", path.display())]
33 MissingBundle { path: PathBuf },
34}
35
36#[derive(Debug, Error)]
37pub enum EvalRunError {
38 #[error("agent run failed: {0}")]
39 Agent(#[from] RunError),
40
41 #[error("workspace error: {0}")]
42 Workspace(#[from] WorkspaceError),
43}