]> git.proxmox.com Git - proxmox-backup.git/commitdiff
datastore: return error instead of unreachable
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 17 May 2023 14:06:25 +0000 (16:06 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 17 May 2023 14:06:28 +0000 (16:06 +0200)
very unexpected and unreachable is probably fine here, but it's not
really winning us anything, so avoid the panic-potential and just
bail out.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
pbs-datastore/src/catalog.rs

index 949e25b84f01676d42e05c678dc6b9519e4e325c..2b75a80438df5b1ce25862e6b96b8b722c586df6 100644 (file)
@@ -518,7 +518,7 @@ impl<R: Read + Seek> CatalogReader<R> {
                 attr: DirEntryAttribute::Directory { start },
                 ..
             } => self.dump_dir(std::path::Path::new("./"), start),
-            _ => unreachable!(),
+            _ => bail!("unexpected root entry type, not a directory!"),
         }
     }