mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 10:01:17 +00:00
handle not found error in purge-chain (#2274)
This commit is contained in:
committed by
Bastian Köcher
parent
dcb1cafe2a
commit
72a1c6298e
@@ -39,7 +39,7 @@ use network::{
|
||||
use primitives::H256;
|
||||
|
||||
use std::{
|
||||
io::{Write, Read, stdin, stdout}, iter, fs::{self, File}, net::{Ipv4Addr, SocketAddr},
|
||||
io::{Write, Read, stdin, stdout, ErrorKind}, iter, fs::{self, File}, net::{Ipv4Addr, SocketAddr},
|
||||
path::{Path, PathBuf}, str::FromStr,
|
||||
};
|
||||
|
||||
@@ -673,10 +673,17 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
fs::remove_dir_all(&db_path)?;
|
||||
println!("{:?} removed.", &db_path);
|
||||
|
||||
Ok(())
|
||||
match fs::remove_dir_all(&db_path) {
|
||||
Result::Ok(_) => {
|
||||
println!("{:?} removed.", &db_path);
|
||||
Ok(())
|
||||
},
|
||||
Result::Err(ref err) if err.kind() == ErrorKind::NotFound => {
|
||||
println!("{:?} did not exist.", &db_path);
|
||||
Ok(())
|
||||
},
|
||||
Result::Err(err) => Result::Err(err.into())
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_address(
|
||||
|
||||
Reference in New Issue
Block a user