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
//! Error types for authentication and configuration failures.
use thiserror::Error;
/// Errors that can occur during authentication or configuration file manipulation.
#[derive(Error, Debug)]
pub enum AuthError {
/// Authentication failure when resolving credentials via ADC or gcloud CLI.
#[error("Authentication error:\n{0}")]
Authentication(String),
/// File system or I/O failure.
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
/// Missing or invalid configuration (e.g. no Artifact Registry scoped registry found).
#[error("Configuration error: {0}")]
Config(String),
/// Invalid source or destination Yarn configuration.
#[error("YAML parse error in {input}: {source}")]
YamlInput {
/// Whether the error came from the source or credential configuration.
input: &'static str,
/// The underlying YAML parse error.
#[source]
source: yaml_edit::YamlError,
},
/// Invalid Bun configuration.
#[error("TOML parse error in bunfig.toml: {0}")]
TomlInput(#[from] toml_edit::TomlError),
/// Regular expression compilation or matching error.
#[error("Regex error: {0}")]
Regex(#[from] regex::Error),
}