Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

Commit c268d5b

Browse files
committed
more improvements
1 parent e38a548 commit c268d5b

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/github/api/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ impl HttpClient {
105105
let resp = self
106106
.req(Method::POST, &GitHubUrl::new("graphql", org))?
107107
.json(&Request { query, variables })
108-
.send()?
108+
.send()
109+
.context("failed to send graphql request")?
109110
.custom_error_for_status()?;
110111

111112
let res: GraphResult<R> = resp.json_annotated().with_context(|| {

src/github/api/read.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ impl GithubRead for GitHubApiRead {
282282
},
283283
org,
284284
)
285-
.with_context(|| format!("failed to retrieve repo `{org}/{repo}"))?;
285+
.with_context(|| format!("failed to retrieve repo `{org}/{repo}`"))?;
286286

287287
let repo = result.repository.map(|repo_response| Repo {
288288
node_id: repo_response.id,

src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ impl ResponseExt for Response {
1313
match self.error_for_status_ref() {
1414
Ok(_) => Ok(self),
1515
Err(err) => {
16-
let body = self.text()?;
17-
Err(err).context(format!("Body: {:?}", body))
16+
let body = self.text().context("failed to read response body")?;
17+
Err(err).context(format!("Body: {body:?}"))
1818
}
1919
}
2020
}

0 commit comments

Comments
 (0)