diff --git a/src/include/functions_common.php b/src/include/functions_common.php
index c4fd7e4..6217651 100644
--- a/src/include/functions_common.php
+++ b/src/include/functions_common.php
@@ -1034,7 +1034,8 @@ function DieWithErrorMsg( $szerrmsg )
}
else if ( $RUNMODE == RUNMODE_WEBSERVER )
{
- print(
+ // Print main error!
+ print (
"
Adiscon LogAnalyzer :: Critical Error occured" .
"
" .
"".
@@ -1044,7 +1045,20 @@ function DieWithErrorMsg( $szerrmsg )
"
" .
" " .
$szerrmsg .
- "
|
" .
+ "
");
+
+ // Print Detail error's if available
+ if ( isset($content['detailederror']) )
+ {
+ print ("".
+ "
" .
+ " " .
+ $content['detailederror'] .
+ "
|
");
+ }
+
+ // End HTML Body
+ print(
""
);
}
diff --git a/src/include/functions_db.php b/src/include/functions_db.php
index 69406cb..9d63488 100644
--- a/src/include/functions_db.php
+++ b/src/include/functions_db.php
@@ -211,13 +211,14 @@ function DB_ReturnSimpleErrorMsg()
function DB_PrintError($MyErrorMsg, $DieOrNot)
{
- global $n,$HTTP_COOKIE_VARS, $errdesc, $errno, $linesep;
+ global $content, $n,$HTTP_COOKIE_VARS, $errdesc, $errno, $linesep;
$errdesc = mysql_error();
$errno = mysql_errno();
// Define global variable so we know an error has occured!
- define('PHPLOGCON_INERROR', true);
+ if ( !defined('PHPLOGCON_INERROR') )
+ define('PHPLOGCON_INERROR', true);
$errormsg="Database error: $MyErrorMsg $linesep";
$errormsg.="mysql error: $errdesc $linesep";
@@ -229,7 +230,20 @@ function DB_PrintError($MyErrorMsg, $DieOrNot)
if ($DieOrNot == true)
DieWithErrorMsg( "$linesep" . $errormsg );
else
+ {
OutputDebugMessage("DB_PrintError: $errormsg", DEBUG_ERROR);
+
+ if ( !isset($content['detailederror']) )
+ {
+ $content['detailederror_code'] = ERROR_DB_QUERYFAILED;
+ $content['detailederror'] = GetErrorMessage(ERROR_DB_QUERYFAILED);
+ }
+ else
+ $content['detailederror'] .= "
" . GetErrorMessage(ERROR_DB_QUERYFAILED);
+
+ // Append SQL Detail Error
+ $content['detailederror'] .= "
" . $errormsg;
+ }
}
function DB_RemoveParserSpecialBadChars($myString)