Request building error handler

pull/153/head
spikecodes 2 years ago
parent fb7faf6477
commit 07363e47a9
No known key found for this signature in database
GPG Key ID: 004CECFF9B463BCB
  1. 6
      src/client.rs

@ -64,7 +64,11 @@ fn request(url: String) -> Boxed<Result<Response<Body>, String>> {
.header("Accept-Language", "en-US,en;q=0.5")
.header("Connection", "keep-alive")
.body(Body::empty())
.expect("request builder")
.map_err(|e| {
println!("Error building request to send to Reddit: {} - URL: {}", e.to_string(), uri);
e
})
.unwrap_or_default()
};
async move {

Loading…
Cancel
Save