diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-06-23 10:03:27 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-07-06 10:58:12 +0200 |
commit | 917002f3ecc91b1d06a4ca126bbbf392cee1285f (patch) | |
tree | 83530523f16b516ed7ea8eea0e167242feea82f1 /lib | |
parent | 8df392738c2e3168c38565dc1c3062b94c1e3bee (diff) | |
download | nextcloud-server-917002f3ecc91b1d06a4ca126bbbf392cee1285f.tar.gz nextcloud-server-917002f3ecc91b1d06a4ca126bbbf392cee1285f.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.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/updater.php b/lib/private/updater.php index c6c2ad2257d..64f8dc355d1 100644 --- a/lib/private/updater.php +++ b/lib/private/updater.php @@ -136,14 +136,20 @@ class Updater extends BasicEmitter { } $this->emit('\OC\Updater', 'maintenanceStart'); + $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; } \OC_Config::setValue('maintenance', false); $this->emit('\OC\Updater', 'maintenanceEnd'); + $this->emit('\OC\Updater', 'updateEnd', array($success)); + + return $success; } /** |