Skip to main content

ic_asset/error/
upload.rs

1use super::AssembleCommitBatchArgumentError;
2use crate::error::compatibility::CompatibilityError;
3use crate::error::create_project_asset::CreateProjectAssetError;
4use ic_agent::AgentError;
5use thiserror::Error;
6
7/// Errors encountered during the upload process.
8#[derive(Error, Debug)]
9pub enum UploadError {
10    /// Failed when querying the asset canister for its API version.
11    #[error("Failed to query asset canister API version")]
12    ApiVersionQueryFailed(#[source] AgentError),
13
14    /// Failed when calling commit_batch.
15    #[error("Commit batch failed")]
16    CommitBatchFailed(#[source] AgentError),
17
18    /// Failure when trying to work with an older asset canister.
19    #[error(transparent)]
20    Compatibility(#[from] CompatibilityError),
21
22    /// Failed when calling create_batch.
23    #[error("Create batch failed")]
24    CreateBatchFailed(#[source] AgentError),
25
26    /// Failed when assembling commit_batch argument.
27    #[error("Failed to assemble commit_batch argument")]
28    AssembleCommitBatchArgumentFailed(#[from] AssembleCommitBatchArgumentError),
29
30    /// Failed when creating project assets.
31    #[error("Failed to create project asset")]
32    CreateProjectAssetFailed(#[from] CreateProjectAssetError),
33
34    /// Failed when calling the list method.
35    #[error("List assets failed")]
36    ListAssetsFailed(#[source] AgentError),
37}