better errors when editing tasks directly
This commit is contained in:
parent
2c5acbe61d
commit
bc861c52f2
@ -73,7 +73,13 @@ pub fn edit_raw(id : Id, vault_folder : path::PathBuf, editor : &str, state : &m
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let mut edited_task = tasks::Task::load_direct(temp_path.clone(), true)?;
|
let mut edited_task = tasks::Task::load_direct(temp_path.clone(), true)
|
||||||
|
.map_err(|err| {
|
||||||
|
match err {
|
||||||
|
error::Error::TomlDe(err) => error::Error::Generic(format!("Bad toml data - {}", err)),
|
||||||
|
x => x,
|
||||||
|
}
|
||||||
|
})?;
|
||||||
|
|
||||||
// Make sure ID is not changed.
|
// Make sure ID is not changed.
|
||||||
if edited_task.data.id != task.data.id {
|
if edited_task.data.id != task.data.id {
|
||||||
|
Loading…
Reference in New Issue
Block a user