1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
mod configuration;
mod properties;
pub use configuration::{Configuration, ConfigurationStore};
pub use properties::*;
use std::path::PathBuf;
use thiserror::Error;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, Error)]
pub enum Error {
#[error("Unable to locate user configuration directory")]
ConfigurationDirectoryNotFound,
#[error("Unable to find the gcloud configuration directory at {0}\n\nIs gcloud installed?")]
ConfigurationStoreNotFound(PathBuf),
#[error("Unable to load properties")]
LoadingProperties(#[from] serde_ini::de::Error),
#[error("A configuration named '{0}' already exists. Use --force to overwrite it")]
ExistingConfiguration(String),
#[error("'{0}' is invalid. Configuration names must only contain ASCII letters and numbers")]
InvalidName(String),
#[error("I/O error")]
Io(#[from] std::io::Error),
#[error("Unable to find any gcloud configurations in {0}")]
NoConfigurationsFound(PathBuf),
#[error("Unable to save properties")]
SavingProperties(#[from] serde_ini::ser::Error),
#[error("Unable to find configuration '{0}'")]
UnknownConfiguration(String),
}