Skip to main content

ucp_translator_html/
error.rs

1//! Error types for HTML translation.
2
3use thiserror::Error;
4
5/// HTML translation error
6#[derive(Debug, Error)]
7pub enum HtmlError {
8    #[error("Parse error: {0}")]
9    Parse(String),
10
11    #[error("Invalid HTML structure: {0}")]
12    InvalidStructure(String),
13
14    #[error("Unsupported element: {0}")]
15    UnsupportedElement(String),
16
17    #[error("Invalid URL: {0}")]
18    InvalidUrl(String),
19
20    #[error("Resource limit exceeded: {0}")]
21    ResourceLimit(String),
22
23    #[error("Core error: {0}")]
24    Core(#[from] ucm_core::Error),
25}
26
27/// Result type for HTML translation
28pub type Result<T> = std::result::Result<T, HtmlError>;