Skip to content

Commit 081512d

Browse files
committed
return an error when fetching an issue fails
1 parent 21b5af0 commit 081512d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

crates/rust-project-goals/src/gh/issues.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ pub fn fetch_issue(repository: &Repository, issue: u64) -> Result<ExistingGithub
112112
.arg("title,assignees,number,comments,body,state,labels,milestone")
113113
.output()?;
114114

115+
if !output.status.success() {
116+
spanned::bail_here!(
117+
"fetching `{}` issue {} failed: {}",
118+
repository.to_string(),
119+
issue,
120+
String::from_utf8_lossy(&output.stderr)
121+
);
122+
}
123+
115124
let e_i: ExistingGithubIssueJson = serde_json::from_slice(&output.stdout)?;
116125

117126
Ok(ExistingGithubIssue::from(e_i))

0 commit comments

Comments
 (0)