diff --git a/src/Entry.php b/src/Entry.php index 3b49fdf..d1309f7 100644 --- a/src/Entry.php +++ b/src/Entry.php @@ -3,6 +3,7 @@ namespace Markup\Contentful; use Markup\Contentful\Exception\LinkUnresolvableException; +use Markup\Contentful\Exception\ResourceUnavailableException; class Entry implements EntryInterface { @@ -62,6 +63,8 @@ public function getField($key) $resolvedLink = call_user_func($this->resolveLinkFunction, $this->fields[$key])->wait(); } catch (LinkUnresolvableException $e) { $resolvedLink = null; + } catch (ResourceUnavailableException $e) { + $resolvedLink = null; } $this->resolvedLinks[$key] = $resolvedLink; } @@ -76,6 +79,8 @@ public function getField($key) } catch (LinkUnresolvableException $e) { //if the link is unresolvable we should consider it not published and return null so this is filtered out return null; + } catch (ResourceUnavailableException $e) { + return null; } return $resolvedLink;