1
0

better exception switch for db connect errors

This commit is contained in:
Ian
2013-04-08 17:56:43 +02:00
parent 0c0367ceab
commit 7548e68c31
2 changed files with 2 additions and 3 deletions

View File

@ -110,7 +110,7 @@ if (!function_exists('errorToExceptionHandler')) {
}
print_r($debugbacktrace);
}
if (!S9Y_DBCON_HALT_ERROR) {
if ($serendipity['dbConn']) {
// debugbacktrace is nice, but additional it is good to have the verbosity of SPL EXCEPTIONS, except for db connect errors
throw new ErrorException($errStr); // tracepath = all, if not ini_set('display_errors', 0);
} else {
@ -123,7 +123,7 @@ if (!function_exists('errorToExceptionHandler')) {
echo '<p> == TESTING ERROR MODE == </p>';
echo '<pre>';
//print_r($args); // do this in strong test environments only, as containing sensible data! Better use debug!
if (!S9Y_DBCON_HALT_ERROR) {
if ($serendipity['dbConn']) {
// debugbacktrace is nice, but additional it is good to have the verbosity of SPL EXCEPTIONS, except for db connect errors
throw new ErrorException($errStr); // tracepath = all, if not ini_set('display_errors', 0);
} else {

View File

@ -288,7 +288,6 @@ if (serendipity_FUNCTIONS_LOADED !== true) {
if (!serendipity_db_connect()) {
$serendipity['lang'] = 'en';
include(S9Y_INCLUDE_PATH . 'include/lang.inc.php');
define('S9Y_DBCON_HALT_ERROR', true);
serendipity_die(DATABASE_ERROR);
}