Turn error into warning for failing GH API fetch, print response

This commit is contained in:
Felix Schütt
2022-11-18 16:35:38 +01:00
parent 43c94ffb4c
commit 71563bc21f

View File

@@ -1379,10 +1379,11 @@ mod http_fetch {
.context("Could not lookup wasmer repository on Github.")?;
if response.status_code() != StatusCode::new(200) {
return Err(anyhow!(
"Github API replied with non-200 status code: {}",
response.status_code()
));
eprintln!(
"Warning: Github API replied with non-200 status code: {}. Response: {}",
response.status_code(),
String::from_utf8_lossy(&writer),
);
}
let v: std::result::Result<serde_json::Value, _> = serde_json::from_reader(&*writer);