1use crate::{format, Rc};
5
6type String = Rc<str>;
7
8#[derive(Debug, Clone, thiserror::Error)]
10pub enum TargetError {
11 #[error("JSON parse error: {0}")]
13 JsonParseError(String),
14 #[error("Deserialization error: {0}")]
16 DeserializationError(String),
17 #[error("Duplicate constant value: {0}")]
19 DuplicateConstantValue(String),
20 #[error("Multiple default schemas: {0}")]
22 MultipleDefaultSchemas(String),
23 #[error("Empty resource schemas: {0}")]
25 EmptyResourceSchemas(String),
26 #[error("Empty effect schemas: {0}")]
28 EmptyEffectSchemas(String),
29}
30
31impl From<serde_json::Error> for TargetError {
32 fn from(error: serde_json::Error) -> Self {
33 TargetError::JsonParseError(format!("{}", error).into())
34 }
35}