1#[derive(Debug, thiserror::Error)]
2pub enum Error {
3 #[error(transparent)]
4 YamlError(#[from] serde_yaml::Error),
5
6 #[error("Unsupported yaml type: {0:?}")]
7 UnsupportedType(serde_yaml::Value),
8
9 #[error("Cannot get colorized string without feature `color` enabled")]
10 ColorizeWithoutFeature,
11}
12
13#[cfg(target_family = "wasm")]
14impl From<Error> for wasm_bindgen::prelude::JsValue {
15 fn from(value: Error) -> wasm_bindgen::prelude::JsValue {
16 wasm_bindgen::prelude::JsValue::from_str(&value.to_string())
17 }
18}