Log attachment fetching errors

This commit is contained in:
silverpill 2022-09-18 23:57:39 +00:00
parent dd6317561e
commit c488d5b5d4

View file

@ -177,7 +177,10 @@ pub async fn handle_note(
let attachment_url = attachment.url
.ok_or(ValidationError("attachment URL is missing"))?;
let (file_name, media_type) = fetch_file(&attachment_url, media_dir).await
.map_err(|_| ValidationError("failed to fetch attachment"))?;
.map_err(|err| {
log::warn!("{}", err);
ValidationError("failed to fetch attachment")
})?;
log::info!("downloaded attachment {}", attachment_url);
downloaded.push((
file_name,