From 605050df9b42ba68b2d8c34a4075a5af4ebd312c Mon Sep 17 00:00:00 2001
From: kondou <kondou@ts.unde.re>
Date: Fri, 9 Aug 2013 18:01:49 +0200
Subject: [PATCH] Log exception at the catching code

---
 lib/app.php                 | 10 +++++-----
 settings/ajax/enableapp.php |  1 +
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/app.php b/lib/app.php
index 1ff18c799c..8ac4a16ffd 100644
--- a/lib/app.php
+++ b/lib/app.php
@@ -235,11 +235,11 @@ class OC_App{
 			$info=OC_App::getAppInfo($app);
 			$version=OC_Util::getVersion();
 			if(!isset($info['require']) or !self::isAppVersionCompatible($version, $info['require'])) {
-				OC_Log::write('core',
-					'App "'.$info['name'].'" can\'t be installed because it is'
-					.' not compatible with this version of ownCloud',
-					OC_Log::ERROR);
-				throw new \Exception($l->t("App can't be installed because it is not compatible with this version of ownCloud."));
+				throw new \Exception(
+					$l->t("App \"%s\" can't be installed because it is not compatible with this version of ownCloud.",
+						array($info['name'])
+					)
+				);
 			}else{
 				OC_Appconfig::setValue( $app, 'enabled', 'yes' );
 				if(isset($appdata['id'])) {
diff --git a/settings/ajax/enableapp.php b/settings/ajax/enableapp.php
index 0784736a65..735794360b 100644
--- a/settings/ajax/enableapp.php
+++ b/settings/ajax/enableapp.php
@@ -7,5 +7,6 @@ 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()) ));
 }
-- 
GitLab