From f6426cee047e435fbed020105ef4e896b68b1e10 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Sat, 5 Jan 2013 12:13:36 -0500 Subject: Tweak failure message and throw exceptions from updateDbFromStructure() --- core/ajax/update.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'core/ajax') 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(); -- cgit v1.2.3