aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-06-13 13:50:31 -0700
committerThomas Müller <thomas.mueller@tmit.eu>2013-06-13 13:50:31 -0700
commit2a58cf81175d35754c682a4e89acb4fed1d7d6f9 (patch)
tree84ac45c8c363615e24cba30a8b4f14a431b97f24
parentc6fd3f9820c8a39a8c91c2600eec2d16c7424b24 (diff)
parent31f7afe56adf8cae80b31d5a94cd37fc857bef9d (diff)
downloadnextcloud-server-2a58cf81175d35754c682a4e89acb4fed1d7d6f9.tar.gz
nextcloud-server-2a58cf81175d35754c682a4e89acb4fed1d7d6f9.zip
Merge pull request #3686 from owncloud/minor_exception_cleanup
minor cleanup for exception handling
-rw-r--r--lib/db.php8
-rw-r--r--lib/template.php2
2 files changed, 3 insertions, 7 deletions
diff --git a/lib/db.php b/lib/db.php
index 080e895e352..cd96bcf9d31 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -568,10 +568,6 @@ class OC_DB {
self::raiseExceptionOnError($definition,'Failed to parse the database definition');
- // Die in case something went wrong
- if( $definition instanceof MDB2_Schema_Error ) {
- OC_Template::printErrorPage( $definition->getMessage().': '.$definition->getUserInfo() );
- }
if(OC_Config::getValue('dbtype', 'sqlite')==='oci') {
unset($definition['charset']); //or MDB2 tries SHUTDOWN IMMEDIATE
$oldname = $definition['name'];
@@ -921,7 +917,7 @@ class OC_DB {
}
}
/**
- * check if a result is an error, writes a log entry and throws an exception, works with MDB2 and PDOException
+ * check if a result is an error and throws an exception, works with MDB2 and PDOException
* @param mixed $result
* @param string message
* @return void
@@ -934,7 +930,7 @@ class OC_DB {
} else {
$message .= ', Root cause:' . self::getErrorMessage($result);
}
- throw new DatabaseException($message, getErrorCode($result));
+ throw new DatabaseException($message, self::getErrorCode($result));
}
}
diff --git a/lib/template.php b/lib/template.php
index 01f0fc28b60..ae9ea187445 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -547,7 +547,7 @@ class OC_Template{
$error_msg = '['.$exception->getCode().'] '.$error_msg;
}
$hint = $exception->getTraceAsString();
- while ($exception = $exception->previous()) {
+ while (method_exists($exception,'previous') && $exception = $exception->previous()) {
$error_msg .= '<br/>Caused by: ';
if ($exception->getCode()) {
$error_msg .= '['.$exception->getCode().'] ';