Use return value: fail if content could not be written

This commit is contained in:
Matthias Beyer 2016-01-05 16:07:29 +01:00
parent c380e0f64f
commit 67dd4d3be1

View file

@ -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");