Request building error handler

This commit is contained in:
spikecodes 2021-03-17 16:53:49 -07:00
parent fb7faf6477
commit 07363e47a9
No known key found for this signature in database
GPG Key ID: 004CECFF9B463BCB

View File

@ -64,7 +64,11 @@ fn request(url: String) -> Boxed<Result<Response<Body>, String>> {
.header("Accept-Language", "en-US,en;q=0.5") .header("Accept-Language", "en-US,en;q=0.5")
.header("Connection", "keep-alive") .header("Connection", "keep-alive")
.body(Body::empty()) .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 { async move {