Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: More logging during package downloads #4898

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions lib/wasix/src/runtime/package_loader/builtin_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl BuiltinPackageLoader {
options: Default::default(),
};

tracing::debug!(%request.url, %request.method, "Downloading a webc file");
tracing::debug!(%request.url, %request.method, "webc_package_download_start");
tracing::trace!(?request.headers);

let response = self.client.request(request).await?;
Expand All @@ -154,15 +154,18 @@ impl BuiltinPackageLoader {
"Received a response",
);

let url = &dist.webc;
if !response.is_ok() {
let url = &dist.webc;
return Err(crate::runtime::resolver::utils::http_error(&response)
.context(format!("The GET request to \"{url}\" failed")));
return Err(
crate::runtime::resolver::utils::http_error(&response).context(format!(
"package download failed: GET request to \"{}\" failed with status {}",
url, response.status
)),
);
}

let body = response
.body
.context("The response didn't contain a body")?;
let body = response.body.context("package download failed")?;
tracing::debug!(%url, "package_download_succeeded");

Ok(body.into())
}
Expand Down
Loading