From 37b02fdcaefcd98f4a468e22b003e82f17f1b8b8 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 9 Nov 2016 09:25:47 +0100 Subject: [PATCH] Use a better error message and point the users to the support channels Signed-off-by: Joas Schilling --- lib/private/installer.php | 8 ++++++++ lib/private/updater.php | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/lib/private/installer.php b/lib/private/installer.php index 83649dd4181..3b39357b4b6 100644 --- a/lib/private/installer.php +++ b/lib/private/installer.php @@ -586,6 +586,14 @@ class OC_Installer{ $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 support channels.' + ); + } } //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()));