summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-03-27 13:56:39 +0200
committerGitHub <noreply@github.com>2023-03-27 13:56:39 +0200
commit6741b373560f969707dd96be44d18182c1ec4848 (patch)
treec30d4a28594e40fd3b2049214b474a2fdfd3a0e3 /lib
parent1e85cb135e0094eba8cee23c81e0bc6316ea43fd (diff)
parentb6d1154260b775ccfccac2302e340ae1b445c93c (diff)
downloadnextcloud-server-6741b373560f969707dd96be44d18182c1ec4848.tar.gz
nextcloud-server-6741b373560f969707dd96be44d18182c1ec4848.zip
Merge pull request #37198 from nextcloud/bugfix/noid/reference-image-log
fix(references): Do not log errors on 404 responses of opengraph image fetching
Diffstat (limited to 'lib')
-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]);
}