snix_castore/import/
error.rs

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