diff options
author | Florian Pritz <bluewind@xinu.at> | 2015-05-31 10:44:26 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2015-05-31 10:44:26 +0200 |
commit | d5e5051029885f2ccc2a81356d54d76d65ac2aec (patch) | |
tree | 5be212ea0735f477ef738543144dd49b993e8e74 /index.php | |
parent | 3281db65cafe150fbe26606ce6b5bd63da87f8a4 (diff) |
Display error id when printing exception
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -259,6 +259,9 @@ function _log_exception($ex) foreach ($exceptions as $key => $e) { $message = sprintf("Exception %d/%d '%s' with message '%s' in %s:%d\n", $key+1, count($exceptions), get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()); + if (method_exists($e, "get_error_id")) { + $message .= 'Error ID: '.$e->get_error_id()."\n"; + } if (method_exists($e, "get_data") && $e->get_data() !== NULL) { $message .= 'Data: '.var_export($e->get_data(), true)."\n"; } @@ -294,6 +297,9 @@ function _actual_exception_handler($ex) $message .= '<b>Exception '.($key+1).' of '.count($exceptions).'</b><br>'; $message .= '<b>Fatal error</b>: Uncaught exception '.htmlspecialchars(get_class($e)).'<br>'; $message .= '<b>Message</b>: '.htmlspecialchars($e->getMessage()).'<br>'; + if (method_exists($e, "get_error_id")) { + $message .= '<b>Error ID</b>: '.htmlspecialchars($e->get_error_id()).'<br>'; + } if (method_exists($e, "get_data") && $e->get_data() !== NULL) { $message .= '<b>Data</b>: <pre>'.htmlspecialchars(var_export($e->get_data(), true)).'</pre><br>'; } |