ic_asset/error/hash_content.rs
1use crate::asset::content_encoder::ContentEncoder;
2use crate::error::fs::ReadFileError;
3use thiserror::Error;
4
5/// Errors related to hashing asset content.
6#[derive(Error, Debug)]
7pub enum HashContentError {
8 /// Failed to encode the content in order to compute the hash.
9 #[error("Failed to encode content of '{0}' with {1} encoding")]
10 EncodeContentFailed(String, ContentEncoder, #[source] std::io::Error),
11
12 /// Failed to load asset content from the filesystem.
13 #[error("failed to load content")]
14 LoadContentFailed(#[from] ReadFileError),
15}