reactive_graph_serde/
error.rs1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum DeserializationError {
5 #[error("Failed to deserialize JSON failed: {0}")]
6 Json(#[from] serde_json::Error),
7 #[cfg(feature = "json5")]
8 #[error("Failed to deserialize JSON5 failed: {0}")]
9 Json5(#[from] json5::Error),
10 #[cfg(feature = "toml")]
11 #[error("Failed to deserialize TOML failed: {0}")]
12 Toml(#[from] toml::de::Error),
13}
14
15#[derive(Debug, Error)]
16pub enum SerializationError {
17 #[error("Failed to serialize JSON: {0}")]
18 Json(#[from] serde_json::Error),
19 #[cfg(feature = "json5")]
20 #[error("Failed to serialize JSON5: {0}")]
21 Json5(#[from] json5::Error),
22 #[cfg(feature = "toml")]
23 #[error("Failed to serialize TOML: {0}")]
24 Toml(#[from] toml::ser::Error),
25}