Skip to main content

autumn_plugin_d3/
error.rs

1//! The crate error type.
2
3/// An error from the chart builder.
4#[derive(Debug, thiserror::Error)]
5#[non_exhaustive]
6pub enum Error {
7    /// A custom kind name is not valid. See
8    /// [`Chart::custom`](crate::Chart::custom).
9    #[error(
10        "invalid custom chart kind {0:?}: use 1-64 of a-z, 0-9, -; start with a letter; do not use a built-in name"
11    )]
12    InvalidKind(String),
13    /// Custom data did not serialize to JSON.
14    #[error("chart data does not serialize to JSON: {0}")]
15    Json(#[from] serde_json::Error),
16}