Skip to content

Commit bb4b61f

Browse files
committed
Handle error response for GitHub commits endpoint.
1 parent e26646c commit bb4b61f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: src/github.rs

+9
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,15 @@ impl CommitsQuery<'_> {
148148
.url();
149149

150150
let response: Response = client.get(&url).send()?;
151+
let status = response.status();
152+
if !status.is_success() {
153+
bail!(
154+
"error: url <{}> response {}: {}",
155+
url,
156+
status,
157+
response.text().unwrap_or_else(|_| format!("<empty>"))
158+
);
159+
}
151160

152161
let action = parse_paged_elems(response, |elem: GithubCommitElem| {
153162
let found_last = elem.sha == self.earliest_sha;

0 commit comments

Comments
 (0)