streamdown_core/error.rs
1//! Error types for streamdown
2
3use thiserror::Error;
4
5/// Main error type for streamdown operations
6#[derive(Error, Debug)]
7pub enum StreamdownError {
8 /// IO error during file operations
9 #[error("IO error: {0}")]
10 Io(#[from] std::io::Error),
11
12 /// Configuration error
13 #[error("Configuration error: {0}")]
14 Config(String),
15
16 /// Parse error during markdown processing
17 #[error("Parse error: {0}")]
18 Parse(String),
19
20 /// Render error during output generation
21 #[error("Render error: {0}")]
22 Render(String),
23
24 /// Plugin error
25 #[error("Plugin error: {0}")]
26 Plugin(String),
27}
28
29/// Result type alias for streamdown operations
30pub type Result<T> = std::result::Result<T, StreamdownError>;