Skip to main content

tiptap_rusty_parser/
error.rs

1//! Error types.
2
3use thiserror::Error;
4
5/// Errors produced while parsing or serializing a document.
6#[derive(Debug, Error)]
7pub enum ParseError {
8    /// Underlying `serde_json` (de)serialization failure.
9    #[error("json error: {0}")]
10    Json(#[from] serde_json::Error),
11
12    /// I/O failure while reading from a reader.
13    #[error("io error: {0}")]
14    Io(#[from] std::io::Error),
15}
16
17/// Crate result alias.
18pub type Result<T> = std::result::Result<T, ParseError>;