Improve error message on creation of interpreted environment

Signed-off-by: Olivier <olivier@librepush.net>
This commit is contained in:
Olivier 'reivilibre' 2024-06-19 23:51:12 +01:00
parent 981812c796
commit b7818dddc1
1 changed files with 7 additions and 3 deletions

View File

@ -72,12 +72,16 @@ pub fn new_template_manager(
successful.expect(&format!("Could not find Hornbeam templates/translations: tried looking in {try_paths:?} and no HORNBEAM_BASE environment variable set!"))
};
let template_sys = load_new_template_system(
let template_sys = match load_new_template_system(
default_locale,
&base_dir.join("templates"),
&base_dir.join("translations"),
)
.expect("Failed to create Hornbeam environment!");
) {
Ok(v) => v,
Err(err) => {
panic!("Failed to create Hornbeam environment! {err}");
}
};
let templates = Arc::new(ArcSwap::new(Arc::new(template_sys)));
#[cfg(feature = "hot_reload")]