瀏覽代碼

Use a better error message and point the users to the support channels

Signed-off-by: Joas Schilling <coding@schilljs.com>
tags/v11.0RC2
Joas Schilling 7 年之前
父節點
當前提交
224dfaf1e6
沒有連結到貢獻者的電子郵件帳戶。
共有 2 個檔案被更改,包括 13 行新增1 行删除
  1. 9
    1
      lib/private/Installer.php
  2. 4
    0
      lib/private/Updater.php

+ 9
- 1
lib/private/Installer.php 查看文件

@@ -41,6 +41,7 @@

namespace OC;

use Doctrine\DBAL\Exception\TableExistsException;
use OC\App\AppStore\Fetcher\AppFetcher;
use OC\App\CodeChecker\CodeChecker;
use OC\App\CodeChecker\EmptyCheck;
@@ -457,7 +458,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

+ 4
- 0
lib/private/Updater.php 查看文件

@@ -121,6 +121,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()));

Loading…
取消
儲存