From d5e5051029885f2ccc2a81356d54d76d65ac2aec Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 31 May 2015 10:44:26 +0200 Subject: Display error id when printing exception Signed-off-by: Florian Pritz --- index.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'index.php') diff --git a/index.php b/index.php index 9f68db123..e3e06323a 100644 --- a/index.php +++ b/index.php @@ -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 .= 'Exception '.($key+1).' of '.count($exceptions).'
'; $message .= 'Fatal error: Uncaught exception '.htmlspecialchars(get_class($e)).'
'; $message .= 'Message: '.htmlspecialchars($e->getMessage()).'
'; + if (method_exists($e, "get_error_id")) { + $message .= 'Error ID: '.htmlspecialchars($e->get_error_id()).'
'; + } if (method_exists($e, "get_data") && $e->get_data() !== NULL) { $message .= 'Data:
'.htmlspecialchars(var_export($e->get_data(), true)).'

'; } -- cgit v1.2.3-24-g4f1b