refactor(tvix/castore): add separate Error enum for archives
The `Error` enum for the `imports` crate has both filesystem and archive specific errors and was starting to get messy. This adds a separate `Error` enum for archive-specific errors and then keeps a single `Archive` variant in the top-level import `Error` for all archive errors. Change-Id: I4cd0746c864e5ec50b1aa68c0630ef9cd05176c7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11498 Tested-by: BuildkiteCI Autosubmit: Connor Brewster <cbrewster@hey.com> Reviewed-by: flokli <flokli@flokli.de>
This commit is contained in:
parent
79698c470c
commit
d2e67f021e
3 changed files with 37 additions and 33 deletions
|
|
@ -19,20 +19,8 @@ pub enum Error {
|
|||
#[error("unable to read {0}: {1}")]
|
||||
UnableToRead(PathBuf, std::io::Error),
|
||||
|
||||
#[error("error reading from archive: {0}")]
|
||||
Archive(std::io::Error),
|
||||
|
||||
#[error("unsupported file {0} type: {1:?}")]
|
||||
UnsupportedFileType(PathBuf, FileType),
|
||||
|
||||
#[error("unsupported tar entry {0} type: {1:?}")]
|
||||
UnsupportedTarEntry(PathBuf, tokio_tar::EntryType),
|
||||
|
||||
#[error("symlink missing target {0}")]
|
||||
MissingSymlinkTarget(PathBuf),
|
||||
|
||||
#[error("unexpected number of top level directory entries")]
|
||||
UnexpectedNumberOfTopLevelEntries,
|
||||
}
|
||||
|
||||
impl From<CastoreError> for Error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue