diff options
author | Joas Schilling <coding@schilljs.com> | 2016-11-09 09:10:32 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-11-09 09:20:55 +0100 |
commit | ef917ee9c80108dfcb6c98cb2ded41fb7b189924 (patch) | |
tree | 038b8e7ccd4b2ee467f74875d8f33a640f814e9a | |
parent | 825a403f9cf69a50a24837609f616aeb325324d6 (diff) | |
download | nextcloud-server-ef917ee9c80108dfcb6c98cb2ded41fb7b189924.tar.gz nextcloud-server-ef917ee9c80108dfcb6c98cb2ded41fb7b189924.zip |
Use a better error message and point the users to the support channels
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | lib/private/Installer.php | 10 | ||||
-rw-r--r-- | lib/private/Updater.php | 4 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/private/Installer.php b/lib/private/Installer.php index 009df790585..cb2b841dca9 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; @@ -561,7 +562,14 @@ class 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 (TableExistsException $e) { + throw new 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>.' + ); + } } //run appinfo/install.php diff --git a/lib/private/Updater.php b/lib/private/Updater.php index 609e965bfad..1864758c852 100644 --- a/lib/private/Updater.php +++ b/lib/private/Updater.php @@ -149,6 +149,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())); |