From 736614d6334a2c4f0858dd1fac1d4c4cd2c081d6 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 17 Aug 2021 20:33:06 -0400 Subject: [PATCH] Fixing an issue with pictrs errors --- crates/utils/src/request.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/utils/src/request.rs b/crates/utils/src/request.rs index 1882e538c..bb6056217 100644 --- a/crates/utils/src/request.rs +++ b/crates/utils/src/request.rs @@ -163,15 +163,21 @@ pub async fn fetch_site_metadata_and_pictrs_data( let pictrs_hash = match &metadata_option { Some(metadata_res) => match &metadata_res.image { Some(metadata_image) => fetch_pictrs(client, metadata_image) - .await? + .await + // Ignore the error, just return None + .unwrap_or(None) .map(|r| r.files[0].file.to_owned()), // Try to generate a small thumbnail if there's a full sized one from post-links None => fetch_pictrs(client, url) - .await? + .await + // Ignore the error, just return None + .unwrap_or(None) .map(|r| r.files[0].file.to_owned()), }, None => fetch_pictrs(client, url) - .await? + .await + // Ignore the error, just return None + .unwrap_or(None) .map(|r| r.files[0].file.to_owned()), };