Messy fix unti we got url sanitization.

Fixed a bug where program would panic if the Get Request
to where the feed image is would fail.
This commit is contained in:
Jordan Petridis
2017-10-21 08:12:28 +03:00
parent 86019710a1
commit 64cd388aeb
+6 -1
View File
@@ -158,7 +158,12 @@ pub fn cache_image(title: &str, image_uri: Option<&str>) -> Option<String> {
return Some(dlpath);
}
download_to(&dlpath, url).unwrap();
if let Err(err) = download_to(&dlpath, url) {
error!("Failed to get feed image.");
error!("Error: {}", err);
return None;
};
info!("Cached img into: {}", dlpath);
return Some(dlpath);
}