Skip to main content

ic_asset/error/
sync.rs

1use crate::error::compatibility::CompatibilityError;
2use crate::error::upload_content::UploadContentError;
3use ic_agent::AgentError;
4use thiserror::Error;
5
6/// Errors related to the sync process.
7#[derive(Error, Debug)]
8pub enum SyncError {
9    /// Failed when querying the asset canister for its API version.
10    #[error("Failed to query asset canister API version")]
11    ApiVersionQueryFailed(#[source] AgentError),
12
13    /// Failed when calling commit_batch
14    #[error("Failed to commit batch")]
15    CommitBatchFailed(#[source] AgentError),
16
17    /// Failed when trying to work with an older asset canister.
18    #[error(transparent)]
19    Compatibility(#[from] CompatibilityError),
20
21    /// Failed when uploading content for synchronization.
22    #[error(transparent)]
23    UploadContentFailed(#[from] UploadContentError),
24}