1
0

Show error when createPreview fails

This commit is contained in:
2022-10-15 17:13:55 +02:00
parent e54522c3f8
commit 31c0bda8cb
3 changed files with 20 additions and 3 deletions

View File

@@ -20,7 +20,13 @@ echo '<body>';
foreach ($SITE->modules->Books()->listAll() as $book)
{
echo 'Create preview for ' . $book['title'] . '<br/>' . "\n";
$SITE->modules->Books()->createPreview($book);
try {
$SITE->modules->Books()->createPreview($book);
} catch (Exception $e) {
echo '<strong>Failed to create preview for ' . $book['title'] . ':' . $e->getMessage() . '</strong><br/>' . "\n";
}
}
echo 'Finished.' . '<br/>' . "\n";