trek_rs/error.rs
1//! Error types for Trek
2
3use thiserror::Error;
4
5/// Trek error types
6#[derive(Error, Debug)]
7pub enum TrekError {
8 /// HTML parsing error
9 #[error("Failed to parse HTML: {0}")]
10 HtmlParse(String),
11
12 /// DOM manipulation error
13 #[error("DOM manipulation error: {0}")]
14 DomError(String),
15
16 /// Selector parsing error
17 #[error("Invalid CSS selector: {0}")]
18 SelectorError(String),
19
20 /// Content extraction error
21 #[error("Failed to extract content: {0}")]
22 ExtractionError(String),
23
24 /// WASM-specific error
25 #[cfg(target_arch = "wasm32")]
26 #[error("WASM error: {0}")]
27 WasmError(String),
28
29 /// Generic error
30 #[error("Trek error: {0}")]
31 Other(String),
32}