mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-20 19:11:08 +03:00
Improve error output in cases when db_root / logfile is inaccesible (#2424)
This commit is contained in:
parent
8c4d14f654
commit
f66bf3cb05
2 changed files with 4 additions and 3 deletions
|
@ -66,7 +66,8 @@ pub fn new_env(path: String) -> lmdb::Environment {
|
|||
/// Create a new LMDB env under the provided directory with the provided name.
|
||||
pub fn new_named_env(path: String, name: String) -> lmdb::Environment {
|
||||
let full_path = [path, name].join("/");
|
||||
fs::create_dir_all(&full_path).unwrap();
|
||||
fs::create_dir_all(&full_path)
|
||||
.expect("Unable to create directory 'db_root' to store chain_data");
|
||||
|
||||
let mut env_builder = lmdb::EnvBuilder::new().unwrap();
|
||||
env_builder.set_maxdbs(8).unwrap();
|
||||
|
|
|
@ -136,7 +136,7 @@ pub fn init_logger(config: Option<LoggingConfig>) {
|
|||
.append(c.log_file_append)
|
||||
.encoder(Box::new(PatternEncoder::new(&LOGGING_PATTERN)))
|
||||
.build(c.log_file_path, Box::new(policy))
|
||||
.unwrap(),
|
||||
.expect("Failed to create logfile"),
|
||||
)
|
||||
} else {
|
||||
Box::new(
|
||||
|
@ -144,7 +144,7 @@ pub fn init_logger(config: Option<LoggingConfig>) {
|
|||
.append(c.log_file_append)
|
||||
.encoder(Box::new(PatternEncoder::new(&LOGGING_PATTERN)))
|
||||
.build(c.log_file_path)
|
||||
.unwrap(),
|
||||
.expect("Failed to create logfile"),
|
||||
)
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue