feat: add hostname and full_hostname meta plugins with error handling

Co-authored-by: aider (openai/andrew.openrouter.qwen.qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-07-29 12:11:46 -03:00
parent 5a41021188
commit 3de832d886
4 changed files with 130 additions and 4 deletions

View File

@@ -172,10 +172,16 @@ pub fn mode_save(
for meta_plugin in meta_plugins.iter_mut() {
let meta_name = meta_plugin.meta_name();
// TODO: Add error handling instead of unwrap.
let meta_value = meta_plugin.finalize().unwrap();
store_item_meta_value(conn, item.clone(), meta_name, meta_value)?;
match meta_plugin.finalize() {
Ok(meta_value) => {
if let Err(e) = store_item_meta_value(conn, item.clone(), meta_name, meta_value) {
eprintln!("Warning: Failed to store meta value for {}: {}", meta_name, e);
}
}
Err(e) => {
eprintln!("Warning: Failed to finalize meta plugin {}: {}", meta_name, e);
}
}
}
db::update_item(conn, item.clone())?;