fix: more accurate error message

This commit is contained in:
selene 2026-01-12 17:28:10 +01:00
parent 7ae145be20
commit 9e2a19d56e
Signed by: sel
SSH key fingerprint: SHA256:33R/4Rx5Lu4o81LyJyXdMrmP5CJ6j7j1Soo0Dn7mKc0

View file

@ -18,7 +18,7 @@ impl ObjectTemplate {
let template: ObjectTemplate = match modules.get(object_type) {
Some(ModuleItem::Template(template_str)) => toml::from_str(template_str).unwrap(),
Some(_) => panic!("{} is not a ModuleItem::Template", object_type),
None => return Err(format!("template {} doesn't exist", object_type))
None => return Err(format!("ModuleItem {} doesn't exist", object_type))
};
Ok(template)