diff --git a/src/fetch.rs b/src/fetch.rs index b72e335..a59c886 100644 --- a/src/fetch.rs +++ b/src/fetch.rs @@ -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::() - .unwrap() + .error_for_status() + { + Ok(response) => response.json::().unwrap(), + Err(err) => { + panic!("Request to Gitlab failed: {err}") + } + } } /// Fetches all results from the API with pagination in mind.