print message when cache file is unreadable

This commit is contained in:
soruh 2023-02-15 14:28:30 +01:00
parent 3c141c590a
commit 0ecbd50c8a

View File

@ -145,7 +145,10 @@ impl PortHandler {
}
fn load_or_default(cache: &Path) -> Self {
Self::load(cache).unwrap_or(Self::default())
Self::load(cache).unwrap_or_else(|err| {
println!("failed to parse cache file at {cache:?} using empty cache. error: {err}");
Self::default()
})
}
fn update_allowed_ports(&mut self, allowed_ports: &AllowedPorts) {