use std::io;
#[derive(Debug, thiserror::Error)]
pub enum OpenClawError {
#[error("failed to parse config at {path}: {reason}")]
ConfigParse { path: String, reason: String },
#[error("workspace not found: {id}")]
WorkspaceNotFound { id: String },
#[error("failed to read document at {path}")]
DocRead {
path: String,
#[source]
source: io::Error,
},
#[error("failed to write document at {path}")]
DocWrite {
path: String,
#[source]
source: io::Error,
},
#[error("validation failed: {reason}")]
Validation { reason: String },
#[error("I/O error for {path}")]
Io {
path: String,
#[source]
source: io::Error,
},
}