Skip to main content

corundum_framework_package/
error.rs

1/// What can go wrong with a package's updates.
2#[derive(Debug, thiserror::Error)]
3pub enum Error {
4    /// The app is not running from a package, so there is nothing to update.
5    #[error("the app is not installed from a package")]
6    NotPackaged,
7    /// The update feed could not be reached.
8    #[error("network error: {0}")]
9    Network(String),
10    /// Velopack itself failed.
11    #[error("Velopack error: {0}")]
12    Velopack(String),
13    /// An update is being applied already, from another thread.
14    #[error("an update is being applied already")]
15    Applying,
16    /// The app's `before_apply` refused the update.
17    #[error("could not prepare for the update: {0}")]
18    Prepare(String),
19    /// Another program has the command's name: a file that is not a link, or a link to
20    /// another program, left alone.
21    #[error("another {command} is installed at {}", path.display())]
22    Taken {
23        command: String,
24        path: std::path::PathBuf,
25    },
26    /// The command line could not be put on or taken off `PATH`.
27    #[error("could not change the command line on PATH: {0}")]
28    CliPath(String),
29    /// A file could not be read or written.
30    #[error(transparent)]
31    Io(#[from] std::io::Error),
32}