Better handling of errors, not good, but better.

This commit is contained in:
2019-01-17 10:46:46 +01:00
parent b214f9b621
commit a3e515c3a7
11 changed files with 162 additions and 25 deletions

View File

@@ -5,7 +5,7 @@ use crate::probe::Probe;
pub struct VemRingde;
impl Probe for VemRingde {
fn search(&mut self, ctx: &mut Context, number: &str) {
fn search(&mut self, ctx: &mut Context, number: &str) -> Result<(), ()> {
let body = if let Some(cache) = ctx.cache_get("vem_ringde", &number) {
String::from_utf8(cache.data).unwrap()
} else {
@@ -17,5 +17,7 @@ impl Probe for VemRingde {
ctx.cache_set("vem_ringde", &number, body.as_bytes())
.expect("wut?! why not?!");
Err(())
}
}