summaryrefslogtreecommitdiffstats
path: root/lib/private/Collaboration/Reference
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2023-03-13 18:18:04 +0100
committerJulius Härtl <jus@bitgrid.net>2023-03-13 18:18:04 +0100
commitb6d1154260b775ccfccac2302e340ae1b445c93c (patch)
tree5f20e374a7bf6ca7421af323a9307d532429b2a9 /lib/private/Collaboration/Reference
parent4b79e75072f59d2ada4a95413e730a14fe461e9c (diff)
downloadnextcloud-server-b6d1154260b775ccfccac2302e340ae1b445c93c.tar.gz
nextcloud-server-b6d1154260b775ccfccac2302e340ae1b445c93c.zip
fix(references): Do not log errors on 404 responses of opengraph image fetching
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/Collaboration/Reference')
-rw-r--r--lib/private/Collaboration/Reference/LinkReferenceProvider.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/Collaboration/Reference/LinkReferenceProvider.php b/lib/private/Collaboration/Reference/LinkReferenceProvider.php
index 2a6d4d5afaf..448a55f9300 100644
--- a/lib/private/Collaboration/Reference/LinkReferenceProvider.php
+++ b/lib/private/Collaboration/Reference/LinkReferenceProvider.php
@@ -25,6 +25,7 @@ declare(strict_types=1);
namespace OC\Collaboration\Reference;
use Fusonic\OpenGraph\Consumer;
+use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Psr7\LimitStream;
use GuzzleHttp\Psr7\Utils;
use OC\Security\RateLimiting\Exception\RateLimitExceededException;
@@ -167,6 +168,8 @@ class LinkReferenceProvider implements IReferenceProvider {
$folder->newFile(md5($reference->getId()), $bodyStream->getContents());
$reference->setImageUrl($this->urlGenerator->linkToRouteAbsolute('core.Reference.preview', ['referenceId' => md5($reference->getId())]));
}
+ } catch (GuzzleException $e) {
+ $this->logger->info('Failed to fetch and store the open graph image for ' . $reference->getId(), ['exception' => $e]);
} catch (\Throwable $e) {
$this->logger->error('Failed to fetch and store the open graph image for ' . $reference->getId(), ['exception' => $e]);
}