1use std::path::PathBuf;
4
5use thiserror::Error;
6
7#[derive(Debug, Error)]
9pub enum CoreError {
10 #[error(transparent)]
12 Io(#[from] std::io::Error),
13 #[error(transparent)]
15 Http(#[from] reqwest::Error),
16 #[error(transparent)]
18 Archive(#[from] zip::result::ZipError),
19 #[error(transparent)]
21 Config(#[from] vs_config::ConfigError),
22 #[error(transparent)]
24 Registry(#[from] vs_registry::RegistryError),
25 #[error(transparent)]
27 Installer(#[from] vs_installer::InstallerError),
28 #[error(transparent)]
30 Shell(#[from] vs_shell::ShellError),
31 #[error(transparent)]
33 Plugin(#[from] vs_plugin_api::PluginError),
34 #[error("plugin {0} is not known to the registry or local home")]
36 UnknownPlugin(String),
37 #[error("{0}")]
39 Unsupported(String),
40 #[error("session scope requires VS_SESSION_ID to be set")]
42 MissingSessionId,
43 #[error("tool {0} is not currently active")]
45 InactiveTool(String),
46 #[error("failed to parse registry source at {path}: {message}")]
48 RegistrySource { path: PathBuf, message: String },
49 #[error("failed to execute command {command}: {message}")]
51 CommandExecution { command: String, message: String },
52 #[error("no migration source home is available")]
54 MissingMigrationSource,
55 #[error(
57 "plugin backend {backend} is not enabled in this build; rebuild with the `{feature}` feature"
58 )]
59 UnsupportedBackend {
60 backend: &'static str,
61 feature: &'static str,
62 },
63}