Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-11-09 16:02:11 +0300
committerGitHub <noreply@github.com>2016-11-09 16:02:11 +0300
commitaef790a34694ffc2152a652600ce51d8e837fc64 (patch)
tree4113f5ff07b468de45aac698d745f6b8d5d35c79
parent6f562d01079910ae3fe6dae541cd145cf0404155 (diff)
parentef53c5f75c48e5b280c7a079b505767f91c2acf3 (diff)
Merge pull request #2060 from nextcloud/backport-2058-better-error-message-for-installation-error-9
[stable9] Use a better error message and point the users to the support channels
-rw-r--r--lib/private/installer.php19
-rw-r--r--lib/private/updater.php4
-rw-r--r--settings/templates/help.php5
3 files changed, 21 insertions, 7 deletions
diff --git a/lib/private/installer.php b/lib/private/installer.php
index 83649dd4181..a3b714d7b3e 100644
--- a/lib/private/installer.php
+++ b/lib/private/installer.php
@@ -556,9 +556,12 @@ class OC_Installer{
if ($softErrors) {
try {
OC_Installer::installShippedApp($filename);
- } catch (\Doctrine\DBAL\Exception\TableExistsException $e) {
- $errors[$filename] = $e;
- continue;
+ } catch (\OC\HintException $e) {
+ if ($e->getPrevious() instanceof \Doctrine\DBAL\Exception\TableExistsException) {
+ $errors[$filename] = $e;
+ continue;
+ }
+ throw $e;
}
} else {
OC_Installer::installShippedApp($filename);
@@ -585,7 +588,15 @@ class OC_Installer{
//install the database
$appPath = OC_App::getAppPath($app);
if(is_file("$appPath/appinfo/database.xml")) {
- OC_DB::createDbFromStructure("$appPath/appinfo/database.xml");
+ try {
+ OC_DB::createDbFromStructure("$appPath/appinfo/database.xml");
+ } catch (\Doctrine\DBAL\Exception\TableExistsException $e) {
+ throw new \OC\HintException(
+ 'Failed to enable app ' . $app,
+ 'Please ask for help via one of our <a href="https://nextcloud.com/support/" target="_blank" rel="noreferrer">support channels</a>.',
+ 0, $e
+ );
+ }
}
//run appinfo/install.php
diff --git a/lib/private/updater.php b/lib/private/updater.php
index c1dbca24fe7..1a0e2d85ad4 100644
--- a/lib/private/updater.php
+++ b/lib/private/updater.php
@@ -212,6 +212,10 @@ class Updater extends BasicEmitter {
$success = true;
try {
$this->doUpgrade($currentVersion, $installedVersion);
+ } catch (HintException $exception) {
+ $this->log->logException($exception, ['app' => 'core']);
+ $this->emit('\OC\Updater', 'failure', array($exception->getMessage() . ': ' .$exception->getHint()));
+ $success = false;
} catch (\Exception $exception) {
$this->log->logException($exception, ['app' => 'core']);
$this->emit('\OC\Updater', 'failure', array(get_class($exception) . ': ' .$exception->getMessage()));
diff --git a/settings/templates/help.php b/settings/templates/help.php
index f248abc066c..954400d33b5 100644
--- a/settings/templates/help.php
+++ b/settings/templates/help.php
@@ -28,9 +28,8 @@
<?php if($_['admin']) { ?>
<li>
- <a href="https://github.com/nextcloud/server/blob/master/CONTRIBUTING.md"
- target="_blank" rel="noreferrer">
- <?php p($l->t('Issue tracker')); ?> ↗
+ <a href="https://nextcloud.com/support/" target="_blank" rel="noreferrer">
+ <?php p($l->t('Getting help')); ?> ↗
</a>
</li>
<?php } ?>