]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(references): Do not log errors on 404 responses of opengraph image fetching 37440/head
authorJulius Härtl <jus@bitgrid.net>
Mon, 13 Mar 2023 17:18:04 +0000 (18:18 +0100)
committerJulius Härtl <jus@bitgrid.net>
Tue, 28 Mar 2023 06:18:30 +0000 (08:18 +0200)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
lib/private/Collaboration/Reference/LinkReferenceProvider.php

index 2a6d4d5afaf075abcde3b92c7cc27a7b0bc67129..448a55f9300e9d0f8a787c4bdf0e1cb4055d0254 100644 (file)
@@ -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]);
                        }