summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-06-23 10:03:27 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-06-23 10:03:27 +0200
commitfe42553e8a034ca246698144b03dc4570fe0b826 (patch)
treeee1d3ee632a795f46c598364b3f3271056fd0266 /lib
parentfdd01cf15c8ef59bc4da41ed3a1dc9e60ce5124e (diff)
downloadnextcloud-server-fe42553e8a034ca246698144b03dc4570fe0b826.tar.gz
nextcloud-server-fe42553e8a034ca246698144b03dc4570fe0b826.zip
[updater] propagate error case properly
* add $success to the updateEnd hook * add new return code for a update failure * add exception class to failure hook message
Diffstat (limited to 'lib')
-rw-r--r--lib/private/updater.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/updater.php b/lib/private/updater.php
index 7f1a493d2a0..1b17face2e0 100644
--- a/lib/private/updater.php
+++ b/lib/private/updater.php
@@ -189,13 +189,16 @@ 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) {
$this->config->setSystemValue('maintenance', false);
@@ -203,6 +206,8 @@ class Updater extends BasicEmitter {
} else {
$this->emit('\OC\Updater', 'maintenanceActive');
}
+
+ return $success;
}
/**