catch errors and send back false
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 1 Jan 2011 20:36:04 +0000 (15:36 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 1 Jan 2011 20:36:04 +0000 (15:36 -0500)
ansel/lib/Ajax/Application.php

index c073055..7cd096e 100644 (file)
@@ -45,7 +45,12 @@ class Ansel_Ajax_Application extends Horde_Core_Ajax_Application
     public function getGallery()
     {
         $id = $this->_vars->id;
-        return $GLOBALS['injector']->getInstance('Ansel_Storage')->getGallery($id)->toJson(true);
+        try {
+            return $GLOBALS['injector']->getInstance('Ansel_Storage')->getGallery($id)->toJson(true);
+        } catch (Exception $e) {
+            Horde::logMessage($e, 'ERR');
+            return false;
+        }
     }
-    
+
 }