diff --git a/ffplayout/src/utils/config.rs b/ffplayout/src/utils/config.rs index 0df489e4..3a2d0186 100644 --- a/ffplayout/src/utils/config.rs +++ b/ffplayout/src/utils/config.rs @@ -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)