mirror of
https://github.com/rust-lang/cargo
synced 2024-09-13 21:11:44 +00:00
Use Message::result_for
for better error messages
Recently fixed in the `curl` crate, this'll allow getting the full and complete error message for each transfer instead of just the error code.
This commit is contained in:
parent
304871c793
commit
bc942919e3
|
@ -22,7 +22,7 @@ bytesize = "1.0"
|
|||
crates-io = { path = "src/crates-io", version = "0.20" }
|
||||
crossbeam-utils = "0.5"
|
||||
crypto-hash = "0.3.1"
|
||||
curl = { version = "0.4.15", features = ['http2'] }
|
||||
curl = { version = "0.4.17", features = ['http2'] }
|
||||
env_logger = "0.5.11"
|
||||
failure = "0.1.2"
|
||||
filetime = "0.2"
|
||||
|
|
|
@ -585,9 +585,11 @@ impl<'a, 'cfg> Downloads<'a, 'cfg> {
|
|||
})?;
|
||||
debug!("handles remaining: {}", n);
|
||||
let results = &mut self.results;
|
||||
let pending = &self.pending;
|
||||
self.set.multi.messages(|msg| {
|
||||
let token = msg.token().expect("failed to read token");
|
||||
if let Some(result) = msg.result() {
|
||||
let handle = &pending[&token].1;
|
||||
if let Some(result) = msg.result_for(&handle) {
|
||||
results.push((token, result.map_err(|e| e.into())));
|
||||
} else {
|
||||
debug!("message without a result (?)");
|
||||
|
|
Loading…
Reference in a new issue