mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-10 17:29:18 -04:00
Change graphics::generate() API so that it doesn't return a boolean,
instead it throws an exception if there's a problem. The normal case for graphics::generate is that it's going to succeed. It'll only fail if something un-handleable went wrong, so just use the resulting exception.
This commit is contained in:
@@ -60,14 +60,15 @@ class gallery_task_Core {
|
||||
|
||||
$item = ORM::factory("item", $row->id);
|
||||
if ($item->loaded) {
|
||||
$success = graphics::generate($item);
|
||||
if (!$success) {
|
||||
try {
|
||||
graphics::generate($item);
|
||||
$ignored[$item->id] = 1;
|
||||
$errors[] = t("Unable to rebuild images for '%title'",
|
||||
array("title" => html::purify($item->title)));
|
||||
} else {
|
||||
$errors[] = t("Successfully rebuilt images for '%title'",
|
||||
array("title" => html::purify($item->title)));
|
||||
} catch (Exception $e) {
|
||||
$errors[] = t("Unable to rebuild images for '%title'",
|
||||
array("title" => html::purify($item->title)));
|
||||
$errors[] = $e->__toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user