Exception handling added
This commit is contained in:
parent
0df88fd5a0
commit
914d4506e2
|
@ -49,7 +49,7 @@ class PostMedia extends BaseFactory implements ICanCreateFromTableRow
|
||||||
{
|
{
|
||||||
return new Entity\PostMedia(
|
return new Entity\PostMedia(
|
||||||
$row['uri-id'],
|
$row['uri-id'],
|
||||||
UtilNetwork::createUriFromString($row['url']) ?: '',
|
UtilNetwork::createUriFromString($row['url']),
|
||||||
$row['type'],
|
$row['type'],
|
||||||
$this->mimeTypeFactory->createFromContentType($row['mimetype']),
|
$this->mimeTypeFactory->createFromContentType($row['mimetype']),
|
||||||
$row['media-uri-id'],
|
$row['media-uri-id'],
|
||||||
|
|
|
@ -45,7 +45,11 @@ class PostMedia extends BaseRepository
|
||||||
|
|
||||||
$Entities = new Collection\PostMedias();
|
$Entities = new Collection\PostMedias();
|
||||||
foreach ($rows as $fields) {
|
foreach ($rows as $fields) {
|
||||||
$Entities[] = $this->factory->createFromTableRow($fields);
|
try {
|
||||||
|
$Entities[] = $this->factory->createFromTableRow($fields);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->logger->warning('Invalid media row', ['code' => $e->getCode(), 'message' => $e->getMessage(), 'fields' => $fields]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $Entities;
|
return $Entities;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user