Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Markup\Contentful;

use Markup\Contentful\Exception\LinkUnresolvableException;
use Markup\Contentful\Exception\ResourceUnavailableException;

class Entry implements EntryInterface
{
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down