log when feedback.read fails

master v0.1.5
bel 2023-03-25 14:40:22 -06:00
parent 645285019e
commit 6bbb9861ef
1 changed files with 11 additions and 6 deletions

View File

@ -357,12 +357,17 @@ impl Feedback {
fn read(&mut self) -> Option<String> { fn read(&mut self) -> Option<String> {
return match &self.cfg.url { return match &self.cfg.url {
Some(url) => match reqwest::blocking::get(url) { Some(url) => {
Ok(resp) => match resp.text() { match reqwest::blocking::get(url) {
Ok(text) => Some(text), Ok(resp) => match resp.text() {
_ => None, Ok(text) => Some(text),
}, _ => None,
_ => None, },
Err(err) => {
eprintln!("feedback.read: cannot fetch: {}", err);
None
},
}
}, },
_ => None, _ => None,
}; };