Use return value: fail if content could not be written
This commit is contained in:
parent
c380e0f64f
commit
67dd4d3be1
1 changed files with 6 additions and 1 deletions
7
src/ui/external/editor.rs
vendored
7
src/ui/external/editor.rs
vendored
|
@ -73,7 +73,12 @@ pub fn edit_content(rt: &Runtime, old_content: String) -> (String, bool) {
|
|||
}
|
||||
};
|
||||
|
||||
file.write(old_content.as_ref());
|
||||
file.write(old_content.as_ref())
|
||||
.map_err(|e| {
|
||||
error!("Error writing content: {}", e);
|
||||
debug!("Error writing content: {:?}", e);
|
||||
exit(1);
|
||||
}).is_ok();
|
||||
}
|
||||
debug!("Ready with putting old content into the file");
|
||||
|
||||
|
|
Loading…
Reference in a new issue