ic_asset/error/
load_config.rs1use crate::error::fs::{ReadDirError, ReadToStringError};
2use crate::error::load_rule::LoadRuleError;
3use std::path::PathBuf;
4use thiserror::Error;
5
6#[derive(Error, Debug)]
8pub enum AssetLoadConfigError {
9 #[error("root_dir '{0}' is expected to be a canonical path")]
11 InvalidRootDir(PathBuf),
12
13 #[error("Failed to load rule in {0}")]
15 LoadRuleFailed(PathBuf, #[source] LoadRuleError),
16
17 #[error("Malformed JSON asset config file '{0}'")]
19 MalformedAssetConfigFile(PathBuf, #[source] json5::Error),
20
21 #[error("both {} and {} files exist in the same directory (dir = {:?})",
23 crate::asset::config::ASSETS_CONFIG_FILENAME_JSON,
24 crate::asset::config::ASSETS_CONFIG_FILENAME_JSON5,
25 .0.display())]
26 MultipleConfigurationFiles(PathBuf),
27
28 #[error(transparent)]
30 ReadDir(#[from] ReadDirError),
31
32 #[error(transparent)]
34 ReadToString(#[from] ReadToStringError),
35}