diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-09-02 15:29:00 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-09-02 15:29:00 -0700 |
commit | 9237ab9bc1e7b3286ceecd5bf6b03cdbfcfa98a5 (patch) | |
tree | 4781b85a4d7f8a46a8a4f1f657852326f247fba8 /modules/gallery/helpers/gallery_task.php | |
parent | b842a9d9ca21d07241b5fa11c5263e18f830c88b (diff) |
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.
Diffstat (limited to 'modules/gallery/helpers/gallery_task.php')
-rw-r--r-- | modules/gallery/helpers/gallery_task.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/modules/gallery/helpers/gallery_task.php b/modules/gallery/helpers/gallery_task.php index c9557324..1b56ab97 100644 --- a/modules/gallery/helpers/gallery_task.php +++ b/modules/gallery/helpers/gallery_task.php @@ -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(); } } |