diff options
Diffstat (limited to 'settings/ajax')
-rw-r--r-- | settings/ajax/enableapp.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/settings/ajax/enableapp.php b/settings/ajax/enableapp.php index ab84aee5166..735794360b3 100644 --- a/settings/ajax/enableapp.php +++ b/settings/ajax/enableapp.php @@ -3,10 +3,10 @@ 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_Log::write('core', $e->getMessage(), OC_Log::ERROR); + OC_JSON::error(array("data" => array("message" => $e->getMessage()) )); } |