Skip to content

Commit ebd489a

Browse files
committed
gha_log: improve a bit the error messages
1 parent 75022c3 commit ebd489a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/gha_logs.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ pub async fn gha_logs(
8888
logs,
8989
} = &*'logs: {
9090
if let Some(logs) = ctx.gha_logs.write().await.get(&log_uuid) {
91-
tracing::info!("gha_logs: cache hit for {log_uuid}");
91+
tracing::info!("gha_logs: cache hit for log {log_uuid}");
9292
break 'logs logs;
9393
}
9494

95-
tracing::info!("gha_logs: cache miss for {log_uuid}");
95+
tracing::info!("gha_logs: cache miss for log {log_uuid}");
9696

9797
let repo = github::IssueRepository {
9898
organization: owner.to_string(),
@@ -104,7 +104,7 @@ pub async fn gha_logs(
104104
.github
105105
.workflow_run_job(&repo, log_id)
106106
.await
107-
.context("unable to fetch job details")?;
107+
.with_context(|| format!("unable to fetch the job details for log {log_id}"))?;
108108

109109
// To minimize false positives in paths linked to the GitHub repositories, we
110110
// restrict matching to only the second-level directories of the repository.
@@ -164,7 +164,7 @@ pub async fn gha_logs(
164164
.github
165165
.raw_job_logs(&repo, log_id)
166166
.await
167-
.context("unable to get the raw logs")?;
167+
.with_context(|| format!("unable to get the raw logs for log {log_id}"))?;
168168

169169
let json_logs =
170170
serde_json::to_string(&*logs).context("unable to JSON-ify the raw logs")?;

0 commit comments

Comments
 (0)