diff options
Diffstat (limited to 'settings/ajax')
-rw-r--r-- | settings/ajax/enableapp.php | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/settings/ajax/enableapp.php b/settings/ajax/enableapp.php index ab84aee5166..0784736a655 100644 --- a/settings/ajax/enableapp.php +++ b/settings/ajax/enableapp.php @@ -3,10 +3,9 @@ OC_JSON::checkAdminUser(); OCP\JSON::callCheck(); -$appid = OC_App::enable(OC_App::cleanAppId($_POST['appid'])); -if($appid !== false) { - OC_JSON::success(array('data' => array('appid' => $appid))); -} else { - $l = OC_L10N::get('settings'); - OC_JSON::error(array("data" => array( "message" => $l->t("Could not enable app. ") ))); +try { + OC_App::enable(OC_App::cleanAppId($_POST['appid'])); + OC_JSON::success(); +} catch (Exception $e) { + OC_JSON::error(array("data" => array("message" => $e->getMessage()) )); } |