Better handling of errors, not good, but better.
This commit is contained in:
@@ -15,7 +15,7 @@ struct Info {
|
||||
pub struct Telefonforsaljare;
|
||||
|
||||
impl Probe for Telefonforsaljare {
|
||||
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("telefonforsaljare", &number) {
|
||||
String::from_utf8(cache.data).unwrap()
|
||||
} else {
|
||||
@@ -38,5 +38,7 @@ impl Probe for Telefonforsaljare {
|
||||
} else {
|
||||
println!(" Failed to find any data");
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user