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
52
53
54
55
#![allow(missing_docs)]
/// Error enum representing different errors that can occur in this crate.
#[derive(Debug, thiserror::Error)]
pub enum Error {
/// Error downloading crate sources from crates.io.
#[error(transparent)]
Download {
#[from]
inner: reqwest::Error,
},
/// Error reading / writing files to / from disk or /tmp space.
#[error(transparent)]
IO {
#[from]
inner: std::io::Error,
},
/// Error querying crates.io for the specified crate.
#[error("Unknown crate: {name}")]
CrateNotFound { name: String },
/// Error querying crates.io for the specified crate version.
#[error("Unknown version for crate '{name}': {version}")]
VersionNotFound { name: String, version: String },
/// Error parsing the repository URL from crate metadata.
#[error("Invalid repository URL: {repo}")]
InvalidRepoUrl { repo: String },
/// Error checking out the specified git ref from the repository.
#[error("Invalid git ref for repository: {repo}#{rev}")]
InvalidGitRef { repo: String, rev: String },
/// Other errors from a subprocess (i.e. git).
#[error("Process failed: [{cmd}]\n{stdout}\n{stderr}")]
Subprocess {
cmd: String,
stdout: String,
stderr: String,
},
/// Error loading crate metadata.
#[error("Failed to load crate metadata: {inner}")]
Metadata { inner: String },
/// Error walking the source directory of a crate.
#[error("Failed to walk source directory: {inner}")]
Walk { inner: String },
/// Error parsing the `.cargo_vcs_info.json` file.
#[error("Failed to load '.cargo_vcs_info.json' file: {inner}")]
VcsInfo { inner: String },
}