summaryrefslogtreecommitdiff
path: root/src/generation.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/generation.rs')
-rw-r--r--src/generation.rs19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/generation.rs b/src/generation.rs
index 4655c17..240f46a 100644
--- a/src/generation.rs
+++ b/src/generation.rs
@@ -2,6 +2,7 @@ use crate::backup_reason::Reason;
use crate::backup_run::{BackupError, BackupResult};
use crate::chunkid::ChunkId;
use crate::fsentry::FilesystemEntry;
+use log::debug;
use rusqlite::Connection;
use std::path::{Path, PathBuf};
@@ -64,15 +65,23 @@ impl NascentGeneration {
pub fn insert_iter<'a>(
&mut self,
entries: impl Iterator<Item = BackupResult<(FilesystemEntry, Vec<ChunkId>, Reason)>>,
- ) -> NascentResult<()> {
+ ) -> NascentResult<Vec<BackupError>> {
let t = self.conn.transaction()?;
+ let mut warnings = vec![];
for r in entries {
- let (e, ids, reason) = r?;
- self.fileno += 1;
- sql::insert_one(&t, e, self.fileno, &ids[..], reason)?;
+ match r {
+ Err(err) => {
+ debug!("ignoring backup error {}", err);
+ warnings.push(err);
+ }
+ Ok((e, ids, reason)) => {
+ self.fileno += 1;
+ sql::insert_one(&t, e, self.fileno, &ids[..], reason)?;
+ }
+ }
}
t.commit()?;
- Ok(())
+ Ok(warnings)
}
}