1use std::path::PathBuf;
2
3use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum CoreError {
8 #[error(transparent)]
10 Io(#[from] std::io::Error),
11 #[error(transparent)]
13 Http(#[from] reqwest::Error),
14 #[error(transparent)]
16 Archive(#[from] zip::result::ZipError),
17 #[error(transparent)]
19 Config(#[from] vs_config::ConfigError),
20 #[error(transparent)]
22 Registry(#[from] vs_registry::RegistryError),
23 #[error(transparent)]
25 Installer(#[from] vs_installer::InstallerError),
26 #[error(transparent)]
28 Shell(#[from] vs_shell::ShellError),
29 #[error(transparent)]
31 Plugin(#[from] vs_plugin_api::PluginError),
32 #[error("plugin {0} is not known to the registry or local home")]
34 UnknownPlugin(String),
35 #[error("{0}")]
37 Unsupported(String),
38 #[error("session scope requires VS_SESSION_ID to be set")]
40 MissingSessionId,
41 #[error("tool {0} is not currently active")]
43 InactiveTool(String),
44 #[error("failed to parse registry source at {path}: {message}")]
46 RegistrySource { path: PathBuf, message: String },
47 #[error("failed to execute command {command}: {message}")]
49 CommandExecution { command: String, message: String },
50 #[error("no migration source home is available")]
52 MissingMigrationSource,
53 #[error(
55 "plugin backend {backend} is not enabled in this build; rebuild with the `{feature}` feature"
56 )]
57 UnsupportedBackend {
58 backend: &'static str,
59 feature: &'static str,
60 },
61}