Merge pull request #472 from nextcloud/show-app-name-in-errormsg
Show app name in error message if app could not be loaded. (#25441)
This commit is contained in:
commit
7cdf6402ff
|
@ -1091,6 +1091,7 @@ class OC_App {
|
||||||
* @throws Exception if no app-name was specified
|
* @throws Exception if no app-name was specified
|
||||||
*/
|
*/
|
||||||
public static function installApp($app) {
|
public static function installApp($app) {
|
||||||
|
$appName = $app; // $app will be overwritten, preserve name for error logging
|
||||||
$l = \OC::$server->getL10N('core');
|
$l = \OC::$server->getL10N('core');
|
||||||
$config = \OC::$server->getConfig();
|
$config = \OC::$server->getConfig();
|
||||||
$ocsClient = new OCSClient(
|
$ocsClient = new OCSClient(
|
||||||
|
@ -1163,7 +1164,11 @@ class OC_App {
|
||||||
}
|
}
|
||||||
\OC_Hook::emit('OC_App', 'post_enable', array('app' => $app));
|
\OC_Hook::emit('OC_App', 'post_enable', array('app' => $app));
|
||||||
} else {
|
} else {
|
||||||
|
if(empty($appName) ) {
|
||||||
throw new \Exception($l->t("No app name specified"));
|
throw new \Exception($l->t("No app name specified"));
|
||||||
|
} else {
|
||||||
|
throw new \Exception($l->t("App '%s' could not be installed!", $appName));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $app;
|
return $app;
|
||||||
|
|
Loading…
Reference in New Issue