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/photo.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/photo.php')
-rw-r--r-- | modules/gallery/helpers/photo.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/gallery/helpers/photo.php b/modules/gallery/helpers/photo.php index 96a66d29..40b645a2 100644 --- a/modules/gallery/helpers/photo.php +++ b/modules/gallery/helpers/photo.php @@ -111,9 +111,11 @@ class photo_Core { // Build our thumbnail/resizes. If we fail to build thumbnail/resize we assume that the image // is bad in some way and discard it. - if (!graphics::generate($photo)) { + try { + graphics::generate($photo); + } catch (Exception $e) { $photo->delete(); - throw new Exception("@todo BAD_IMAGE_FILE"); + throw $e; } // If the parent has no cover item, make this it. |