]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Show a reasonable error message when an image is bad, instead of
authorZach Copley <zach@status.net>
Thu, 10 Mar 2011 18:08:14 +0000 (18:08 +0000)
committerZach Copley <zach@status.net>
Thu, 10 Mar 2011 23:18:14 +0000 (15:18 -0800)
letting the exception continue bubbling up.

actions/newapplication.php

index eb13593536f67a0b18fe04f19243c0e79a5c6856..657c7bcb71c4b3a64422708c311d7c874fded1ad 100644 (file)
@@ -22,7 +22,7 @@
  * @category  Applications
  * @package   StatusNet
  * @author    Zach Copley <zach@status.net>
- * @copyright 2008-2009 StatusNet, Inc.
+ * @copyright 2008-2011 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link      http://status.net/
  */
@@ -290,7 +290,13 @@ class NewApplicationAction extends OwnerDesignAction
             $app->query('ROLLBACK');
         }
 
-        $app->uploadLogo();
+       try {
+            $app->uploadLogo();
+        } catch (Exception $e) {
+            $app->query('ROLLBACK');
+            $this->showForm(_('Invalid image.'));
+           return;      
+       }
 
         $app->query('COMMIT');