use std::path::PathBuf;
use crate::ssh::client::ConnectConfig;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("No configuration files present in any of the default paths:\n {paths}", paths = ConnectConfig::CONFIG_ORDER.iter().map(|path| format!("- {path}")).collect::<Vec<_>>().join("\n"))]
ConfigMissing,
#[error("I/O error while {context}: {source}")]
Io {
context: String,
source: std::io::Error,
},
#[error("I/O error at path {path} while {context}: {source}")]
IoPath {
path: PathBuf,
context: String,
source: std::io::Error,
},
#[error("SSH client error: {0}")]
SshClient(#[from] crate::ssh::client::Error),
#[error("Signstar-common error: {0}")]
SignstarCommon(#[from] signstar_common::Error),
#[error("TOML deserialization error: {0}")]
Toml(#[from] toml::de::Error),
#[error("Validation error while {context}: {source}")]
Validation {
context: String,
source: garde::Report,
},
}