Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-06-23 11:03:27 +0300
committerMorris Jobke <hey@morrisjobke.de>2015-07-06 11:41:16 +0300
commitb94657a554ab25cf38c2306bcc95d02fc03e2e7c (patch)
tree1c10cc87120de4e8b8e66fa9e5ee1087042e18e0 /lib
parente0bf1e4f6e1ab1cfb8e91eccfebd854d1e38d410 (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')
-rw-r--r--lib/private/updater.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/updater.php b/lib/private/updater.php
index d28060c100a..4d2f3ab7d75 100644
--- a/lib/private/updater.php
+++ b/lib/private/updater.php
@@ -159,14 +159,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;
}
$this->config->setSystemValue('maintenance', false);
$this->emit('\OC\Updater', 'maintenanceEnd');
+ $this->emit('\OC\Updater', 'updateEnd', array($success));
+
+ return $success;
}
/**