Skip to content
Draft
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
9 changes: 7 additions & 2 deletions src/Repository/EmbedRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(

public function add(Embed $entity, bool $flush = true): void
{
// Check if embed url does not exists yet (null),
// Check if embed url does not exist yet (null),
// before we try to insert a new DB record
if (null === $this->findOneByUrl($entity->url)) {
// Do not exceed URL length limit defined by db schema
Expand All @@ -38,7 +38,12 @@ public function add(Embed $entity, bool $flush = true): void
$this->getEntityManager()->flush();
}
} catch (\Exception $e) {
$this->logger->warning('Embed URL exceeds allowed length: {url, length}', ['url' => $entity->url, \strlen($entity->url)]);
$this->logger->warning('Failed to store Embed URL in DB: url = {url} (length = {length}); exception = {ex}; msg = {msg}', [
'url' => $entity->url,
'length' => \strlen($entity->url),
'ex' => get_class($e),
'msg' => $e->getMessage(),
]);
}
}
}
Expand Down
Loading