Skip to content

Commit 800b476

Browse files
authored
Merge branch 'master' into less-ar-copying
2 parents 667c95d + 68c94c9 commit 800b476

35 files changed

+551
-630
lines changed

Cargo.lock

+7-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ name = "sccache-dist"
2222
required-features = ["dist-server"]
2323

2424
[dependencies]
25+
anyhow = "1.0"
2526
ar = { version = "0.8", optional = true }
2627
atty = "0.2.6"
2728
base64 = "0.11.0"
@@ -34,7 +35,6 @@ clap = "2.23.0"
3435
counted-array = "0.1"
3536
directories = "1"
3637
env_logger = "0.5"
37-
error-chain = { version = "0.12.1", default-features = false }
3838
filetime = "0.2"
3939
flate2 = { version = "1.0", optional = true, default-features = false, features = ["rust_backend"] }
4040
futures = "0.1.11"

src/azure/blobstore.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl BlobContainer {
110110
Box::new(
111111
self.client
112112
.execute(request)
113-
.chain_err(move || format!("failed GET: {}", uri_copy))
113+
.fwith_context(move || format!("failed GET: {}", uri_copy))
114114
.and_then(|res| {
115115
if res.status().is_success() {
116116
let content_length = res
@@ -119,15 +119,15 @@ impl BlobContainer {
119119
.map(|header::ContentLength(len)| len);
120120
Ok((res.into_body(), content_length))
121121
} else {
122-
Err(ErrorKind::BadHTTPStatus(res.status()).into())
122+
Err(BadHttpStatusError(res.status()).into())
123123
}
124124
})
125125
.and_then(|(body, content_length)| {
126126
body.fold(Vec::new(), |mut body, chunk| {
127127
body.extend_from_slice(&chunk);
128128
Ok::<_, reqwest::Error>(body)
129129
})
130-
.chain_err(|| "failed to read HTTP body")
130+
.fcontext("failed to read HTTP body")
131131
.and_then(move |bytes| {
132132
if let Some(len) = content_length {
133133
if len != bytes.len() as u64 {
@@ -211,7 +211,7 @@ impl BlobContainer {
211211
Ok(())
212212
} else {
213213
trace!("PUT failed with HTTP status: {}", res.status());
214-
Err(ErrorKind::BadHTTPStatus(res.status()).into())
214+
Err(BadHttpStatusError(res.status()).into())
215215
}
216216
}
217217
Err(e) => {

src/azure/credentials.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ impl AzureCredentialsProvider for EnvironmentProvider {
7878

7979
fn credentials_from_environment() -> Result<AzureCredentials> {
8080
let env_conn_str = var("SCCACHE_AZURE_CONNECTION_STRING")
81-
.chain_err(|| "No SCCACHE_AZURE_CONNECTION_STRING in environment")?;
81+
.context("No SCCACHE_AZURE_CONNECTION_STRING in environment")?;
8282

8383
let container_name = var("SCCACHE_AZURE_BLOB_CONTAINER")
84-
.chain_err(|| "No SCCACHE_AZURE_BLOB_CONTAINER in environment")?;
84+
.context("No SCCACHE_AZURE_BLOB_CONTAINER in environment")?;
8585

8686
parse_connection_string(&env_conn_str, container_name)
8787
}

0 commit comments

Comments
 (0)