summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-01-05 12:13:36 -0500
committerMichael Gapczynski <mtgap@owncloud.com>2013-01-05 12:13:36 -0500
commitf6426cee047e435fbed020105ef4e896b68b1e10 (patch)
tree176aa545420859b23ca9f0a43e37bccd6755e801 /lib
parent89823ef4f98640e43163223c7fab95d677a93ad0 (diff)
downloadnextcloud-server-f6426cee047e435fbed020105ef4e896b68b1e10.tar.gz
nextcloud-server-f6426cee047e435fbed020105ef4e896b68b1e10.zip
Tweak failure message and throw exceptions from updateDbFromStructure()
Diffstat (limited to 'lib')
-rwxr-xr-xlib/app.php2
-rw-r--r--lib/db.php10
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/app.php b/lib/app.php
index 48bbe53c744..9d4ead71b90 100755
--- a/lib/app.php
+++ b/lib/app.php
@@ -642,7 +642,7 @@ class OC_App{
}
catch (Exception $e) {
echo 'Failed to upgrade "'.$app.'". Exception="'.$e->getMessage().'"';
- OC_Hook::emit('update', 'failure', 'Error updating '.$info['name'].' app: '.$e->getMessage());
+ OC_Hook::emit('update', 'failure', 'Failed to update '.$info['name'].' app: '.$e->getMessage());
die;
}
OC_Appconfig::setValue($app, 'installed_version', OC_App::getAppVersion($app));
diff --git a/lib/db.php b/lib/db.php
index 7e60b41d230..74e7ca5b0e0 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -495,8 +495,9 @@ class OC_DB {
if (PEAR::isError($previousSchema)) {
$error = $previousSchema->getMessage();
$detail = $previousSchema->getDebugInfo();
- OC_Log::write('core', 'Failed to get existing database structure for upgrading ('.$error.', '.$detail.')', OC_Log::FATAL);
- return false;
+ $message = 'Failed to get existing database structure for updating ('.$error.', '.$detail.')';
+ OC_Log::write('core', $message, OC_Log::FATAL);
+ throw new Exception($message);
}
// Make changes and save them to an in-memory file
@@ -523,8 +524,9 @@ class OC_DB {
if (PEAR::isError($op)) {
$error = $op->getMessage();
$detail = $op->getDebugInfo();
- OC_Log::write('core', 'Failed to update database structure ('.$error.', '.$detail.')', OC_Log::FATAL);
- return false;
+ $message = 'Failed to update database structure ('.$error.', '.$detail.')';
+ OC_Log::write('core', $message, OC_Log::FATAL);
+ throw new Exception($message);
}
return true;
}