Skip to content

Commit

Permalink
Make an error message more descriptive
Browse files Browse the repository at this point in the history
  • Loading branch information
CaspianA1 committed Sep 26, 2024
1 parent 01917b6 commit 7e3d904
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ pub fn get_with_maybe_header(url: &str, maybe_header: Option<(&str, &str)>) -> R
request = request.with_header(header.0, header.1);
}

let response = request.with_timeout(DEFAULT_TIMEOUT_SECONDS).send()?;
let response = request.with_timeout(DEFAULT_TIMEOUT_SECONDS).send()
.map_err(|err| format!("Error with request for URL '{url}': {err}")).to_generic()?;

if response.status_code == EXPECTED_STATUS_CODE {
Ok(response)
Expand Down

0 comments on commit 7e3d904

Please sign in to comment.