diff --git a/server/src/email_extract.rs b/server/src/email_extract.rs index e96e271..393f919 100644 --- a/server/src/email_extract.rs +++ b/server/src/email_extract.rs @@ -798,7 +798,7 @@ pub fn extract_alternative( let body = sp.get_body()?; if let Some(ref summary) = ical_summary { // Prepend summary to plain text body (strip HTML tags) - let summary_text = html2text::from_read(summary.as_bytes(), 80); + let summary_text = html2text::from_read(summary.as_bytes(), 80)?; let combined = format!("{}\n\n{}", summary_text.trim(), body); return Ok(Body::text(combined)); } else { diff --git a/server/src/error.rs b/server/src/error.rs index f868da2..965b484 100644 --- a/server/src/error.rs +++ b/server/src/error.rs @@ -45,4 +45,6 @@ pub enum ServerError { XmlError(#[from] quick_xml::Error), #[error("xml encoding error: {0}")] XmlEncodingError(#[from] quick_xml::encoding::EncodingError), + #[error("html to text error: {0}")] + Html2TextError(#[from] html2text::Error), }