Skip to main content

ic_asset/error/
upload_content.rs

1use crate::error::create_project_asset::CreateProjectAssetError;
2use crate::error::gather_asset_descriptors::GatherAssetDescriptorsError;
3use crate::error::get_asset_properties::GetAssetPropertiesError;
4use ic_agent::AgentError;
5use thiserror::Error;
6
7use super::AssembleCommitBatchArgumentError;
8
9/// Errors related to uploading content to the asset canister.
10#[derive(Error, Debug)]
11pub enum UploadContentError {
12    /// Failed when assembling commit_batch argument.
13    #[error("Failed to assemble commit_batch argument")]
14    AssembleCommitBatchArgumentFailed(#[source] AssembleCommitBatchArgumentError),
15
16    /// Failed when calling create_batch.
17    #[error("Failed to create batch")]
18    CreateBatchFailed(#[source] AgentError),
19
20    /// Failed when creating project assets.
21    #[error("Failed to create project asset")]
22    CreateProjectAssetError(#[from] CreateProjectAssetError),
23
24    /// Failed when building list of assets to synchronize.
25    #[error("Failed to gather asset descriptors")]
26    GatherAssetDescriptorsFailed(#[from] GatherAssetDescriptorsError),
27
28    /// Failed when getting asset properties.
29    #[error(transparent)]
30    GetAssetPropertiesFailed(#[from] GetAssetPropertiesError),
31
32    /// Failed when calling the list method.
33    #[error("Failed to list assets")]
34    ListAssetsFailed(#[source] AgentError),
35}