datastore: return error instead of unreachable

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>
This commit is contained in:
Thomas Lamprecht 2023-05-17 16:06:25 +02:00
parent f09b5afdcd
commit 48efb5268d

View 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!"),
}
}