diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2013-01-05 12:13:36 -0500 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2013-01-05 12:13:36 -0500 |
commit | f6426cee047e435fbed020105ef4e896b68b1e10 (patch) | |
tree | 176aa545420859b23ca9f0a43e37bccd6755e801 /core | |
parent | 89823ef4f98640e43163223c7fab95d677a93ad0 (diff) | |
download | nextcloud-server-f6426cee047e435fbed020105ef4e896b68b1e10.tar.gz nextcloud-server-f6426cee047e435fbed020105ef4e896b68b1e10.zip |
Tweak failure message and throw exceptions from updateDbFromStructure()
Diffstat (limited to 'core')
-rw-r--r-- | core/ajax/update.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/ajax/update.php b/core/ajax/update.php index 1c77a4ab67e..20ab045c892 100644 --- a/core/ajax/update.php +++ b/core/ajax/update.php @@ -10,11 +10,12 @@ if (OC::checkUpgrade(false)) { OC_Hook::connect('update', 'error', $watcher, 'error'); OC_Hook::connect('update', 'error', $watcher, 'failure'); $watcher->success('Turned on maintenance mode'); - $result = OC_DB::updateDbFromStructure(OC::$SERVERROOT.'/db_structure.xml'); - if (!$result) { - $watcher->failure('Error updating database'); + try { + $result = OC_DB::updateDbFromStructure(OC::$SERVERROOT.'/db_structure.xml'); + $watcher->success('Updated database'); + } catch (Exception $exception) { + $watcher->failure($exception->getMessage()); } - $watcher->success('Updated database'); $minimizerCSS = new OC_Minimizer_CSS(); $minimizerCSS->clearCache(); $minimizerJS = new OC_Minimizer_JS(); |