Skip to main content

ic_asset/error/
create_project_asset.rs

1use crate::error::create_encoding::CreateEncodingError;
2use crate::error::fs::{ReadFileError, ReadMetadataError};
3use thiserror::Error;
4
5/// Errors related to creating an asset found in the project in the asset canister.
6#[derive(Error, Debug)]
7pub enum CreateProjectAssetError {
8    /// Failed to create an asset encoding in the asset canister.
9    #[error("Failed to create encoding")]
10    CreateEncodingError(#[from] CreateEncodingError),
11
12    /// Failed to find out the file size of an asset.
13    #[error("failed to determine asset size")]
14    DetermineAssetSizeFailed(#[from] ReadMetadataError),
15
16    /// Failed to load asset content from the filesystem.
17    #[error("failed to load asset content")]
18    LoadContentFailed(#[from] ReadFileError),
19}