Skip to content

Commit 85187bf

Browse files
committed
improve error for fetching goal issues
this will now show the issue and goal causing the error
1 parent 081512d commit 85187bf

File tree

1 file changed

+10
-2
lines changed
  • crates/rust-project-goals-cli/src

1 file changed

+10
-2
lines changed

crates/rust-project-goals-cli/src/rfc.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use rust_project_goals::{
1919
labels::GhLabel,
2020
},
2121
goal::{self, GoalDocument, GoalPlan, ParsedOwners},
22-
spanned::{self, Context, Error, Result},
22+
spanned::{self, Context, Error, Result, Spanned},
2323
team::{get_person_data, TeamName},
2424
};
2525

@@ -301,7 +301,15 @@ fn initialize_issues<'doc>(
301301
Some(issue.clone())
302302
} else {
303303
// If not, load its information from the repository by number.
304-
Some(fetch_issue(repository, tracking_issue.number)?)
304+
let existing_issue =
305+
fetch_issue(repository, tracking_issue.number).map_err(|e| {
306+
e.wrap_str(Spanned::here(format!(
307+
"error while fetching declared tracking issue {} for goal {}",
308+
tracking_issue.number,
309+
desired_issue.goal_document.path.display(),
310+
)))
311+
})?;
312+
Some(existing_issue)
305313
}
306314
} else {
307315
// b. If the markdown does not have a declared tracking issue, then we can search through

0 commit comments

Comments
 (0)