summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-06-23 17:40:55 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-06-23 17:40:55 +0200
commit02b2b605810adcf8862a6b7548e1ed30bc56a2f6 (patch)
treebc485f1d99864fc078f140da19613276c8a7266d /lib
parente01db549a04136f0ddee11245aa3a1b4e6381cca (diff)
parentc86e129ce90c65de92172676b3798a8b48589b58 (diff)
downloadnextcloud-server-02b2b605810adcf8862a6b7548e1ed30bc56a2f6.tar.gz
nextcloud-server-02b2b605810adcf8862a6b7548e1ed30bc56a2f6.zip
Merge pull request #17095 from owncloud/proper-error-handling
Proper error handling
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/filesystem.php2
-rw-r--r--lib/private/updater.php11
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php
index 212deb24b7a..14757c83950 100644
--- a/lib/private/files/filesystem.php
+++ b/lib/private/files/filesystem.php
@@ -382,7 +382,7 @@ class Filesystem {
if (is_null($userObject)) {
\OCP\Util::writeLog('files', ' Backends provided no user object for ' . $user, \OCP\Util::ERROR);
- throw new \OC\User\NoUserException();
+ throw new \OC\User\NoUserException('Backends provided no user object for ' . $user);
}
$homeStorage = \OC_Config::getValue('objectstore');
diff --git a/lib/private/updater.php b/lib/private/updater.php
index bd9e8a65363..00c6569a52f 100644
--- a/lib/private/updater.php
+++ b/lib/private/updater.php
@@ -189,20 +189,25 @@ class Updater extends BasicEmitter {
$this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, array('app' => 'core'));
}
+ $success = true;
try {
$this->doUpgrade($currentVersion, $installedVersion);
} catch (\Exception $exception) {
- $this->emit('\OC\Updater', 'failure', array($exception->getMessage()));
+ \OCP\Util::logException('update', $exception);
+ $this->emit('\OC\Updater', 'failure', array(get_class($exception) . ': ' .$exception->getMessage()));
+ $success = false;
}
- $this->emit('\OC\Updater', 'updateEnd');
+ $this->emit('\OC\Updater', 'updateEnd', array($success));
- if(!$wasMaintenanceModeEnabled) {
+ if(!$wasMaintenanceModeEnabled && $success) {
$this->config->setSystemValue('maintenance', false);
$this->emit('\OC\Updater', 'maintenanceDisabled');
} else {
$this->emit('\OC\Updater', 'maintenanceActive');
}
+
+ return $success;
}
/**