Skip to content

Commit

Permalink
Auto merge of #8553 - alexcrichton:more-maybe-spurious, r=ehuss
Browse files Browse the repository at this point in the history
Flag git http errors as maybe spurious

This showed up in #8544 with an error message of "stream ended at an
unexpected time; class=Http" which sounds like a spurious error.
Termination of a network connection can happen at any time! For now try
to assist in that error by adding another class of error to the list of
maybe spurious errors.
  • Loading branch information
bors committed Jul 28, 2020
2 parents 2d26633 + 39a22ff commit 0d79ba6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cargo/util/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ impl<'a> Retry<'a> {
fn maybe_spurious(err: &Error) -> bool {
if let Some(git_err) = err.downcast_ref::<git2::Error>() {
match git_err.class() {
git2::ErrorClass::Net | git2::ErrorClass::Os | git2::ErrorClass::Zlib => return true,
git2::ErrorClass::Net
| git2::ErrorClass::Os
| git2::ErrorClass::Zlib
| git2::ErrorClass::Http => return true,
_ => (),
}
}
Expand Down

0 comments on commit 0d79ba6

Please sign in to comment.