diff --git a/lib/private/installer.php b/lib/private/installer.php index 83649dd4181d0..a3b714d7b3e47 100644 --- a/lib/private/installer.php +++ b/lib/private/installer.php @@ -556,9 +556,12 @@ public static function installShippedApps($softErrors = false) { 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 @@ 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 (\Doctrine\DBAL\Exception\TableExistsException $e) { + throw new \OC\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 c1dbca24fe71e..1a0e2d85ad482 100644 --- a/lib/private/updater.php +++ b/lib/private/updater.php @@ -212,6 +212,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 f248abc066cce..954400d33b5d7 100644 --- a/settings/templates/help.php +++ b/settings/templates/help.php @@ -28,9 +28,8 @@