Error details of logstream sources will now be shown on detail page as well

This commit is contained in:
Andre Lorbach 2010-04-14 10:48:33 +02:00
parent c06271ff8a
commit 103baa8245
3 changed files with 14 additions and 3 deletions

View File

@ -1363,6 +1363,8 @@ class LogStreamDB extends LogStream {
*/
private function PrintDebugError($szErrorMsg)
{
global $extraErrorDescription;
$errdesc = mysql_error();
$errno = mysql_errno();
@ -1370,6 +1372,9 @@ class LogStreamDB extends LogStream {
$errormsg.="Detail error: $errdesc <br>";
$errormsg.="Error Code: $errno <br>";
// Add to additional error output
$extraErrorDescription = $errormsg;
//Output!
OutputDebugMessage("LogStreamDB|PrintDebugError: $errormsg", DEBUG_ERROR);
}

View File

@ -1556,6 +1556,8 @@ class LogStreamPDO extends LogStream {
*/
private function PrintDebugError($szErrorMsg)
{
global $extraErrorDescription;
$errdesc = $this->_dbhandle == null ? "" : implode( ";", $this->_dbhandle->errorInfo() );
$errno = $this->_dbhandle == null ? "" : $this->_dbhandle->errorCode();
@ -1563,6 +1565,9 @@ class LogStreamPDO extends LogStream {
$errormsg.="Detail error: $errdesc <br>";
$errormsg.="Error Code: $errno <br>";
// Add to additional error output
$extraErrorDescription = $errormsg;
//Output!
OutputDebugMessage("LogStreamPDO|PrintDebugError: $errormsg", DEBUG_ERROR);
}

View File

@ -403,10 +403,11 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['uid_current'
if ( $ret == ERROR_UNDEFINED )
$content['detailederror'] = "Undefined error happened within the logstream.";
// else if ( $ret == ERROR_FILE_NOT_READABLE )
// $content['detailederror'] = "Syslog file is not readable, read access may be denied. ";
else
$content['detailederror'] = "Unknown or unhandeled error occured.";
$content['detailederror'] = "Unknown or unhandeled error occured.";
// Add extra error stuff
if ( isset($extraErrorDescription) )
$content['detailederror'] .= "<br><br>" . GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_EXTRAMSG'], $extraErrorDescription);
}
}