Show a reasonable error message when an image is bad, instead of

letting the exception continue bubbling up.
This commit is contained in:
Zach Copley 2011-03-10 18:08:14 +00:00
parent 64925a275e
commit 1d7f54ee38

View 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');