diff --git a/lib/private/Installer.php b/lib/private/Installer.php index 009df7905854d..2a0a6ed4edb50 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -40,6 +40,7 @@ namespace OC; +use Doctrine\DBAL\Exception\TableExistsException; use OC\App\CodeChecker\CodeChecker; use OC\App\CodeChecker\EmptyCheck; use OC\App\CodeChecker\PrivateCheck; @@ -532,9 +533,12 @@ public static function installShippedApps($softErrors = false) { if ($softErrors) { try { Installer::installShippedApp($filename); - } catch (\Doctrine\DBAL\Exception\TableExistsException $e) { - $errors[$filename] = $e; - continue; + } catch (HintException $e) { + if ($e->getPrevious() instanceof TableExistsException) { + $errors[$filename] = $e; + continue; + } + throw $e; } } else { Installer::installShippedApp($filename); @@ -561,7 +565,15 @@ public static function installShippedApp($app) { //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 (TableExistsException $e) { + throw new HintException( + 'Failed to enable app ' . $app, + 'Please ask for help via one of our support channels.', + 0, $e + ); + } } //run appinfo/install.php diff --git a/lib/private/Updater.php b/lib/private/Updater.php index 609e965bfad88..1864758c85230 100644 --- a/lib/private/Updater.php +++ b/lib/private/Updater.php @@ -149,6 +149,10 @@ public function upgrade() { $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 11726d60387f4..f849ea0f427d7 100644 --- a/settings/templates/help.php +++ b/settings/templates/help.php @@ -28,9 +28,8 @@
  • - - t('Issue tracker')); ?> ↗ + + t('Getting help')); ?> ↗