use std::path::PathBuf;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum CoreError {
#[error(transparent)]
Io(#[from] std::io::Error),
#[error(transparent)]
Http(#[from] reqwest::Error),
#[error(transparent)]
Archive(#[from] zip::result::ZipError),
#[error(transparent)]
Config(#[from] vs_config::ConfigError),
#[error(transparent)]
Registry(#[from] vs_registry::RegistryError),
#[error(transparent)]
Installer(#[from] vs_installer::InstallerError),
#[error(transparent)]
Shell(#[from] vs_shell::ShellError),
#[error(transparent)]
Plugin(#[from] vs_plugin_api::PluginError),
#[error("plugin {0} is not known to the registry or local home")]
UnknownPlugin(String),
#[error("{0}")]
Unsupported(String),
#[error("session scope requires VS_SESSION_ID to be set")]
MissingSessionId,
#[error("tool {0} is not currently active")]
InactiveTool(String),
#[error("failed to parse registry source at {path}: {message}")]
RegistrySource { path: PathBuf, message: String },
#[error("failed to execute command {command}: {message}")]
CommandExecution { command: String, message: String },
#[error("no migration source home is available")]
MissingMigrationSource,
#[error(
"plugin backend {backend} is not enabled in this build; rebuild with the `{feature}` feature"
)]
UnsupportedBackend {
backend: &'static str,
feature: &'static str,
},
}