snix_castore/import/
error.rs

1use super::PathBuf;
2
3use crate::Error as CastoreError;
4
5/// Represents all error types that emitted by ingest_entries.
6/// It can represent errors uploading individual Directories and finalizing
7/// the upload.
8/// It also contains a generic error kind that'll carry ingestion-method
9/// specific errors.
10#[derive(Debug, thiserror::Error)]
11pub enum IngestionError<E: std::fmt::Display> {
12    #[error("error from producer: {0}")]
13    Producer(#[from] E),
14
15    #[error("failed to upload directory at {0}: {1}")]
16    UploadDirectoryError(PathBuf, CastoreError),
17
18    #[error("failed to finalize directory upload: {0}")]
19    FinalizeDirectoryUpload(CastoreError),
20
21    #[error("unexpected end of stream")]
22    UnexpectedEndOfStream,
23}