Commit 316c6136 authored by Carsten  Rose's avatar Carsten Rose
Browse files

AbstractException: formatting of error messages rearranged - By default only...

AbstractException: formatting of error messages rearranged - By default only the error code and the message are displyed. Full error message is displayed if config.ini/showDebugInfo=yes
parent 72f4f415
......@@ -24,27 +24,37 @@ class AbstractException extends \Exception {
* @return string
*/
public function formatException() {
$debug = '';
$store = Store::getInstance();
$this->messageArray['File'] = $this->getFile();
$this->messageArray['Line'] = $this->getLine();
$this->messageArray['Line'] = $this->getLine();
$this->messageArray['Message'] = $this->getMessage();
$this->messageArray['Code'] = $this->getCode();
if (Store::getVar('debugShowStack', STORE_TYPO3) === '1') {
$this->messageArray['Stacktrace'] = '<pre>' . $this->getTraceAsString() . '</pre>';
}
// Layout
$html = '<tr bgcolor="#dddddd"><td colspan="2">Exception</td></tr>';
foreach ($this->messageArray as $key => $value) {
if(is_array($value)) {
$value = var_export($value, true);
$this->messageArray['Stacktrace'] = '<pre>' . $this->getTraceAsString() . '</pre>';
$this->messageArray['Page Id'] = $store->getVar(TYPO3_PAGE_ID, STORE_TYPO3);
$this->messageArray['Content Id'] = $store->getVar(TYPO3_TT_CONTENT_UID, STORE_TYPO3);
$html = "<h2>Error</h2>";
$html .= "<p>Code: " . $this->messageArray['Code'] . "</p>";
$html .= "<p>Message: <strong>" . $this->messageArray['Message'] . "</strong></p>";
$html = "<div class='warning'>$html</div>";
if ($store->getVar(SYSTEM_SHOW_DEBUG_INFO, STORE_SYSTEM) === 'yes') {
// Layout
$debug = '<tr bgcolor="#dddddd"><td colspan="2">Exception</td></tr>';
foreach ($this->messageArray as $key => $value) {
if (is_array($value)) {
$value = var_export($value, true);
}
if ($value !== '' && $value !== false)
$debug .= "<tr>" . "<td>$key</td>" . "<td>$value</td>" . "</tr>";
}
$html .= "<tr>" . "<td>$key</td>" . "<td>$value</td>" . "</tr>";
$debug = "<table border=1>" . $debug . "</table>";
}
return "<table border=1>" . $html . "</table>";
return $html . $debug;
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment