Skip to content

Commit

Permalink
Merge pull request #37440 from nextcloud/backport/37198/stable26
Browse files Browse the repository at this point in the history
[stable26] fix(references): Do not log errors on 404 responses of opengraph image fetching
  • Loading branch information
nickvergessen authored Mar 28, 2023
2 parents 0133e42 + 7a0c2d8 commit 5c70c6f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/private/Collaboration/Reference/LinkReferenceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
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;
Expand Down Expand Up @@ -167,6 +168,8 @@ private function fetchReference(Reference $reference): void {
$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]);
}
Expand Down

0 comments on commit 5c70c6f

Please sign in to comment.