attachments: don't print parsing error for empty bytes

async-cursors
Manos Pitsidianakis 2023-07-13 16:48:59 +03:00
parent d4e605c098
commit 866166eb8e
Signed by: Manos Pitsidianakis
GPG Key ID: 7729C7707F7E09D0
1 changed files with 6 additions and 4 deletions

View File

@ -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(),