1use std::path::PathBuf;
4
5#[derive(Debug, thiserror::Error)]
7#[non_exhaustive]
8pub enum Error {
9 #[error("harness not found: {0}")]
11 NotFound(String),
12
13 #[error("invalid path: {0}")]
15 InvalidPath(PathBuf),
16
17 #[error("environment variable error: {0}")]
19 EnvVar(#[from] std::env::VarError),
20
21 #[error("unsupported platform")]
23 UnsupportedPlatform,
24
25 #[error("IO error: {0}")]
27 Io(#[from] std::io::Error),
28
29 #[error("unsupported MCP config for {harness}: {reason}")]
31 UnsupportedMcpConfig {
32 harness: String,
34 reason: String,
36 },
37
38 #[error("binary detection error: {0}")]
40 BinaryDetection(String),
41
42 #[error("{harness} does not support {scope} scope")]
44 UnsupportedScope { harness: String, scope: String },
45
46 #[error("YAML parse error: {0}")]
48 YamlParse(#[from] serde_yaml::Error),
49
50 #[error("missing required field: {0}")]
52 MissingField(String),
53
54 #[error("missing environment variable: {name}")]
56 MissingEnvVar {
57 name: String,
59 },
60}
61
62pub type Result<T> = std::result::Result<T, Error>;