From 67dd4d3be100ca6f17c9db19e441496a6aec05e6 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 5 Jan 2016 16:07:29 +0100 Subject: [PATCH] Use return value: fail if content could not be written --- src/ui/external/editor.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ui/external/editor.rs b/src/ui/external/editor.rs index ea2980aa..41a83ccf 100644 --- a/src/ui/external/editor.rs +++ b/src/ui/external/editor.rs @@ -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");