Skip to main content

ic_asset/error/
create_encoding.rs

1use crate::asset::content_encoder::ContentEncoder;
2use crate::error::create_chunk::CreateChunkError;
3use thiserror::Error;
4
5/// Errors related to creating/uploading an asset content encoding to the asset canister
6#[derive(Error, Debug)]
7pub enum CreateEncodingError {
8    /// Failed when creating a chunk.
9    #[error("Failed to create chunk")]
10    CreateChunkFailed(#[source] CreateChunkError),
11
12    /// Failed when encoding asset content.
13    #[error("Failed to encode content of '{0}' with {1} encoding")]
14    EncodeContentFailed(String, ContentEncoder, #[source] std::io::Error),
15}