src/section_config.rs - write: improve error message

This commit is contained in:
Dietmar Maurer 2020-01-31 09:08:42 +01:00
parent 501f4fa220
commit c43b36bcb6

View File

@ -155,8 +155,9 @@ impl SectionConfig {
if section_id.chars().any(|c| c.is_control()) {
bail!("detected unexpected control character in section ID.");
}
verify_json_object(section_config, &plugin.properties)?;
if let Err(err) = verify_json_object(section_config, &plugin.properties) {
bail!("verify section '{}' failed - {}", section_id, err);
}
let head = (self.format_section_header)(type_name, section_id, section_config);