summaryrefslogtreecommitdiff
path: root/includes/errors.inc
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-04-03 03:36:11 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-04-03 03:36:11 +0000
commit1e25da7eab1cc9ca572cfbab56b50e342558d631 (patch)
tree31e84f469646242eda85e4a309af4344e2c7d269 /includes/errors.inc
parent807704e1d1a22e50f59c478ddcc5051d68eca48f (diff)
downloadbrdo-1e25da7eab1cc9ca572cfbab56b50e342558d631.tar.gz
brdo-1e25da7eab1cc9ca572cfbab56b50e342558d631.tar.bz2
#742246 by jbrown: Fixed Uncaught exceptions thrown in the exception handler prevent error reporting.
Diffstat (limited to 'includes/errors.inc')
-rw-r--r--includes/errors.inc23
1 files changed, 15 insertions, 8 deletions
diff --git a/includes/errors.inc b/includes/errors.inc
index 4ed7115e4..c82252cbc 100644
--- a/includes/errors.inc
+++ b/includes/errors.inc
@@ -87,7 +87,8 @@ function _drupal_error_handler_real($error_level, $message, $filename, $line, $c
*
* @param $exception
* The exception object that was thrown.
- * @return An error in the format expected by _drupal_log_error().
+ * @return
+ * An error in the format expected by _drupal_log_error().
*/
function _drupal_decode_exception($exception) {
$message = $exception->getMessage();
@@ -126,6 +127,18 @@ function _drupal_decode_exception($exception) {
}
/**
+ * Render an error message for an exception without any possibility of a further exception occuring.
+ *
+ * @param $exception
+ * The exception object that was thrown.
+ * @return
+ * An error message.
+ */
+function _drupal_render_exception_safe($exception) {
+ return strtr('%type: %message in %function (line %line of %file).', _drupal_decode_exception($exception));
+}
+
+/**
* Log a PHP error or exception, display an error page in fatal cases.
*
* @param $error
@@ -163,13 +176,7 @@ function _drupal_log_error($error, $fatal = FALSE) {
$number++;
}
- try {
- watchdog('php', '%type: %message in %function (line %line of %file).', $error, $error['severity_level']);
- }
- catch (Exception $e) {
- // Ignore any additional watchdog exception, as that probably means
- // that the database was not initialized correctly.
- }
+ watchdog('php', '%type: %message in %function (line %line of %file).', $error, $error['severity_level']);
if ($fatal) {
drupal_add_http_header('Status', '500 Service unavailable (with message)');