From 956a5e0455533bf4a50155a467bd9ab8131f2568 Mon Sep 17 00:00:00 2001 From: Pascal Fischert Date: Thu, 26 Sep 2024 14:36:35 +0200 Subject: [PATCH] Logging for missing entries added. --- src/FondOfSpryker/Shared/Contentful/Builder/Builder.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/FondOfSpryker/Shared/Contentful/Builder/Builder.php b/src/FondOfSpryker/Shared/Contentful/Builder/Builder.php index 44a52fc..8b75a41 100644 --- a/src/FondOfSpryker/Shared/Contentful/Builder/Builder.php +++ b/src/FondOfSpryker/Shared/Contentful/Builder/Builder.php @@ -6,9 +6,12 @@ use FondOfSpryker\Shared\Contentful\Renderer\RendererInterface; use Generated\Shared\Transfer\ContentfulEntryRequestTransfer; use Generated\Shared\Transfer\ContentfulEntryResponseTransfer; +use Spryker\Shared\Log\LoggerTrait; class Builder implements BuilderInterface { + use LoggerTrait; + /** * @var \FondOfSpryker\Client\Contentful\ContentfulClientInterface */ @@ -68,6 +71,10 @@ public function getContentfulEntry(string $entryId, string $locale, array $optio $response = $this->client->getEntryBy($request); $renderer = $this->findRendererFor($response); + if ($response->getId() === null) { + $this->getLogger()->error('Contentful entry not found', ['entryId' => $entryId, 'locale' => $locale]); + } + return $renderer->getRawEntry($response, $options); }