Skip to main content

cargo_reg/
errors.rs

1//! Errors for cargo-reg
2
3/// Errors related to alternative registries
4#[derive(Debug, Fail)]
5pub enum RegistryError {
6    /// Indicates an absence of the registry
7    #[fail(display = "no such registry: {}", name)]
8    NoSuchRegistry {
9        /// Registry
10        name: String
11    },
12
13    /// The registry already exists
14    #[fail(display = "this registry already exists: {}", name)]
15    AlreadyExist {
16        /// Registry
17        name: String
18    },
19
20    /// `registries` table is absent in the root of config file
21    #[fail(display = "registries table is absent")]
22    TableAbsent,
23
24    /// Config file is invalid or non TOML
25    #[fail(display = "config file is broken")]
26    BrokenConfig,
27}