unify path errors

This commit is contained in:
jb-alvarado 2024-07-22 11:28:29 +02:00
parent 00f6225791
commit 576d0d62bd

View File

@ -578,10 +578,9 @@ impl PlayoutConfig {
if !global.storage_path.is_dir() {
tokio::fs::create_dir_all(&global.storage_path)
.await
.expect(&format!(
"Can't create storage folder: {:#?}",
global.storage_path
));
.unwrap_or_else(|_| {
panic!("Can't create storage folder: {:#?}", global.storage_path)
});
}
let mut storage = Storage::new(&config, global.storage_path.clone());
@ -594,13 +593,17 @@ impl PlayoutConfig {
if !global.playlist_path.is_dir() {
tokio::fs::create_dir_all(&global.playlist_path)
.await
.expect("Can't create playlist folder");
.unwrap_or_else(|_| {
panic!("Can't create playlist folder: {:#?}", global.playlist_path)
});
}
if !global.logging_path.is_dir() {
tokio::fs::create_dir_all(&global.logging_path)
.await
.expect("Can't create logging folder");
.unwrap_or_else(|_| {
panic!("Can't create logging folder: {:#?}", global.logging_path)
});
}
let (filler_path, _, _) = norm_abs_path(&global.storage_path, &config.storage_filler)