#659 exception handling producing notices, hence causing confusion

SVN:trunk[2625]
This commit is contained in:
Romain Quetiez
2013-03-14 14:22:27 +00:00
parent d620516055
commit c1fae7fd24
2 changed files with 9 additions and 2 deletions

View File

@@ -79,6 +79,7 @@ function FatalErrorCatcher($sOutput)
if ( preg_match('|<phpfatalerror>.*</phpfatalerror>|s', $sOutput, $aMatches) )
{
header("HTTP/1.0 500 Internal server error.");
$errors = '';
foreach ($aMatches as $sMatch)
{
$errors .= strip_tags($sMatch)."\n";

View File

@@ -375,11 +375,17 @@ class ApplicationInstaller
SetupPage::log_error('An exception occurred: '.$e->getMessage().' at line '.$e->getLine().' in file '.$e->getFile());
$idx = 0;
// Log the call stack, but log the parameters since they may contain passwords or other sensitive data
// Log the call stack, but not the parameters since they may contain passwords or other sensitive data
SetupPage::log("Call stack:");
foreach($e->getTrace() as $aTrace)
{
SetupPage::log("#$idx {$aTrace['file']}({$aTrace['line']}): {$aTrace['function']}(...)");
$sLine = empty($aTrace['line']) ? "" : $aTrace['line'];
$sFile = empty($aTrace['file']) ? "" : $aTrace['file'];
$sClass = empty($aTrace['class']) ? "" : $aTrace['class'];
$sType = empty($aTrace['type']) ? "" : $aTrace['type'];
$sFunction = empty($aTrace['function']) ? "" : $aTrace['function'];
$sVerb = empty($sClass) ? $sFunction : "$sClass{$sType}$sFunction";
SetupPage::log("#$idx $sFile($sLine): $sVerb(...)");
$idx++;
}
}