attachments: don't print parsing error for empty bytes

pull/258/head
Manos Pitsidianakis 11 months ago
parent d4e605c098
commit 866166eb8e
No known key found for this signature in database
GPG Key ID: 7729C7707F7E09D0

@ -77,10 +77,12 @@ impl AttachmentBuilder {
let (headers, body) = match parser::attachments::attachment(content) {
Ok((_, v)) => v,
Err(err) => {
log::debug!("error in parsing attachment: {}", err);
log::debug!("\n-------------------------------");
log::debug!("{}\n", String::from_utf8_lossy(content));
log::debug!("-------------------------------\n");
if !content.trim().is_empty() {
log::debug!("error in parsing attachment: {}", err);
log::debug!("\n-------------------------------");
log::debug!("{}\n", String::from_utf8_lossy(content));
log::debug!("-------------------------------\n");
}
return Self {
content_type: Default::default(),

Loading…
Cancel
Save