snix/tvix/castore/src/import/error.rs
Florian Klink 516c6dc572 refactor(tvix/castore/import): use crate Path[Buf] in IngestionEntry
This explicitly splits ingestion-method-specific path types from the
castore types.

Change-Id: Ia3b16105fadb8d52927a4ed79dc4b34efdf4311b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11563
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
2024-05-02 15:26:29 +00:00

20 lines
662 B
Rust

use super::PathBuf;
use crate::Error as CastoreError;
/// Represents all error types that emitted by ingest_entries.
/// It can represent errors uploading individual Directories and finalizing
/// the upload.
/// It also contains a generic error kind that'll carry ingestion-method
/// specific errors.
#[derive(Debug, thiserror::Error)]
pub enum IngestionError<E: std::fmt::Display> {
#[error("error from producer: {0}")]
Producer(#[from] E),
#[error("failed to upload directory at {0}: {1}")]
UploadDirectoryError(PathBuf, CastoreError),
#[error("failed to finalize directory upload: {0}")]
FinalizeDirectoryUpload(CastoreError),
}