aboutsummaryrefslogtreecommitdiffstats
path: root/src/document
diff options
context:
space:
mode:
Diffstat (limited to 'src/document')
-rw-r--r--src/document/file.rs20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/document/file.rs b/src/document/file.rs
index 56114f5..1a33918 100644
--- a/src/document/file.rs
+++ b/src/document/file.rs
@@ -399,16 +399,22 @@ impl DocumentFile {
/// Marks the file as opened (`Record::Opened`), at start, before the node writes:
/// a `Closed` before it no longer says the file holds everything (a crash from here
- /// on leaves it without one). Nothing where there is no file yet.
- pub(crate) fn open(&self) {
+ /// on leaves it without one). Nothing where there is no file yet. Whether the file
+ /// now ends without a `Closed`: where the mark couldn't be appended, it still says
+ /// the run of before stopped cleanly, and the node must not write on as its actor.
+ pub(crate) fn open(&self) -> bool {
if !self.path.exists() {
- return;
+ return true;
}
- if let Err(error) =
- self.files
- .append(FileKind::Document, &self.path, &record(Record::Opened, &[]))
+ match self
+ .files
+ .append(FileKind::Document, &self.path, &record(Record::Opened, &[]))
{
- error!(path = %self.path.display(), error = %error, "Couldn't mark the document file as opened");
+ Ok(()) => true,
+ Err(error) => {
+ error!(path = %self.path.display(), error = %error, "Couldn't mark the document file as opened");
+ false
+ }
}
}