Commit 1e907b7d authored by Carsten  Rose's avatar Carsten Rose
Browse files

Exceptions: added stack (during development) to User and Db. Added getCode()

parent 2c87b6ae
......@@ -33,6 +33,7 @@ class CodeException extends \Exception {
$message .= '<tr bgcolor="#dddddd"><td>Stacktrace</td><td>'. str_replace("\n", "<br>", $this->getTraceAsString()). '</td></tr>' ;
$message .= '</table>';
return($message);
}
}
\ No newline at end of file
......@@ -31,12 +31,14 @@ class DbException extends \Exception {
$message = '<table border=1><tr><th>DB Exception</th></tr>' .
'<tr><td>Message</td><td><b>' . $this->getMessage() . '</b></td></tr>' .
'<tr><td>Code</td><td><b>' . $this->getCode() . '</b></td></tr>' .
'<tr><td>Form</td><td>' . $store->getVar(SYSTEM_FORM, STORE_SYSTEM) . '</td></tr>' .
'<tr><td>Form Element</td><td>' . $store->getVar(SYSTEM_FORM_ELEMENT, STORE_SYSTEM) . '</td></tr>' .
'<tr><td>Form Element Column</td><td>' . $store->getVar(SYSTEM_FORM_ELEMENT_COLUMN, STORE_SYSTEM) . '</td></tr>' .
'<tr><td>SQL before evaluation</td><td>' . $store->getVar(SYSTEM_SQL_RAW, STORE_SYSTEM) . '</td></tr>' .
'<tr><td>SQL after evaluation</td><td>' . $store->getVar(SYSTEM_SQL_FINAL, STORE_SYSTEM) . '</td></tr>' .
'<tr><td>SQL Params</td><td>' . str_replace("\n", "<br>", print_r($store->getVar(SYSTEM_SQL_PARAM_ARRAY, STORE_SYSTEM), true)) . '</td></tr>' .
'<tr bgcolor="#dddddd"><td>Stacktrace</td><td>'. str_replace("\n", "<br>", $this->getTraceAsString()). '</td></tr>' .
'</table>';
return ($message);
......
......@@ -32,9 +32,11 @@ class UserException extends \Exception {
$message = '<table border=1><tr><th>User Exception</th></tr>' .
'<tr><td>Message</td><td><b>' . $this->getMessage() . '</b></td></tr>' .
'<tr><td>Code</td><td><b>' . $this->getCode() . '</b></td></tr>' .
'<tr><td>Form</td><td>' . $store->getVar(SYSTEM_FORM, STORE_SYSTEM) . '</td></tr>' .
'<tr><td>Form Element</td><td>' . $store->getVar(SYSTEM_FORM_ELEMENT, STORE_SYSTEM) . '</td></tr>' .
'<tr><td>Form Element Column</td><td>' . $store->getVar(SYSTEM_FORM_ELEMENT_COLUMN, STORE_SYSTEM) . '</td></tr>' .
'<tr bgcolor="#dddddd"><td>Stacktrace</td><td>'. str_replace("\n", "<br>", $this->getTraceAsString()). '</td></tr>' .
'</table>';
return ($message);
......
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