Skip to main content

snix_castore/import/
error.rs

1use super::PathBuf;
2
3/// Represents all error types that are 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: {0}")]
17    UploadDirectoryError(PathBuf, #[source] crate::directoryservice::Error),
18
19    #[error("failed to add node at {0} to directory: {1}")]
20    ConstructDirectoryError(PathBuf, crate::DirectoryError),
21
22    #[error("failed to finalize directory upload: {0}")]
23    FinalizeDirectoryUpload(#[source] crate::directoryservice::Error),
24
25    #[error("unexpected end of stream")]
26    UnexpectedEndOfStream,
27}