From c1fae7fd2482dea43b163a37fb2a9fab3142faf7 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Thu, 14 Mar 2013 14:22:27 +0000 Subject: [PATCH] #659 exception handling producing notices, hence causing confusion SVN:trunk[2625] --- setup/ajax.dataloader.php | 1 + setup/applicationinstaller.class.inc.php | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/setup/ajax.dataloader.php b/setup/ajax.dataloader.php index df538561a..42e6a9a8e 100644 --- a/setup/ajax.dataloader.php +++ b/setup/ajax.dataloader.php @@ -79,6 +79,7 @@ function FatalErrorCatcher($sOutput) if ( preg_match('|.*|s', $sOutput, $aMatches) ) { header("HTTP/1.0 500 Internal server error."); + $errors = ''; foreach ($aMatches as $sMatch) { $errors .= strip_tags($sMatch)."\n"; diff --git a/setup/applicationinstaller.class.inc.php b/setup/applicationinstaller.class.inc.php index 9bd6ca56d..94af89145 100644 --- a/setup/applicationinstaller.class.inc.php +++ b/setup/applicationinstaller.class.inc.php @@ -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++; } }