diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-06-23 11:03:27 +0300 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-06-23 11:03:27 +0300 |
commit | fe42553e8a034ca246698144b03dc4570fe0b826 (patch) | |
tree | ee1d3ee632a795f46c598364b3f3271056fd0266 /lib/private/updater.php | |
parent | fdd01cf15c8ef59bc4da41ed3a1dc9e60ce5124e (diff) |
[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/private/updater.php')
-rw-r--r-- | lib/private/updater.php | 9 |
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; } /** |