Skip to content

Commit

Permalink
Merge pull request #22 from blitz/missing-data
Browse files Browse the repository at this point in the history
cli: improve error message on expired token
  • Loading branch information
phip1611 authored Dec 17, 2024
2 parents 0a15f14 + c813f47 commit cf24685
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,19 @@ fn fetch_result(
let url = format!("https://{host}/api/graphql", host = host);
let client = Client::new();

client
match client
.post(url)
.header(AUTHORIZATION, authorization)
.json(&payload)
.send()
.unwrap()
.json::<Response>()
.unwrap()
.error_for_status()
{
Ok(response) => response.json::<Response>().unwrap(),
Err(err) => {
panic!("Request to Gitlab failed: {err}")
}
}
}

/// Fetches all results from the API with pagination in mind.
Expand Down

0 comments on commit cf24685

Please sign in to comment.