Use the https problem reports when something goes wrong while downloading a package

Contributes to #5487
This commit is contained in:
Fábio Beirão 2023-06-02 14:09:41 +02:00
parent 60df1b4603
commit 03eb89a721
No known key found for this signature in database
GPG key ID: 13FD3A2130278AAE

View file

@ -1292,7 +1292,6 @@ pub enum LoadingProblem<'a> {
filename: PathBuf,
error: io::ErrorKind,
},
HttpsProblem(Problem),
ParsingFailed(FileError<'a, SyntaxError<'a>>),
UnexpectedHeader(String),
@ -4343,8 +4342,9 @@ fn load_packages<'a>(
}
}
Err(problem) => {
load_messages
.push(Msg::FailedToLoad(LoadingProblem::HttpsProblem(problem)));
let buf = to_https_problem_report_string(src, problem);
load_messages.push(Msg::FailedToLoad(LoadingProblem::FormattedReport(buf)));
return;
}
}