formattable/
error.rs

1//! Error type for crate.
2
3/// Wrapper around the various errors that may be returned during the
4/// serialization process.
5#[derive(Debug, thiserror::Error)]
6pub enum Error {
7    /// Errors from writing to things implementing std::io::Write.
8    #[error(transparent)]
9    Io(#[from] std::io::Error),
10    /// Errors from `serde_json`.
11    #[cfg(feature = "json")]
12    #[error(transparent)]
13    Json(#[from] serde_json::Error),
14
15    /// Errors from `toml`.
16    #[cfg(feature = "toml")]
17    #[error(transparent)]
18    Toml(#[from] toml::ser::Error),
19
20    /// Errors from `serde_yaml`.
21    #[cfg(feature = "yaml")]
22    #[error(transparent)]
23    Yaml(#[from] serde_yaml::Error),
24}