From a71b70f069bba49477b49a3da1e7f81d3d2f0a75 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 8 Apr 2010 18:11:27 +0000 Subject: - Patch #705242 by moshe weitzman: _drupal_log_error() messy for CLI requests. --- includes/errors.inc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'includes') diff --git a/includes/errors.inc b/includes/errors.inc index c82252cbc..a171debb0 100644 --- a/includes/errors.inc +++ b/includes/errors.inc @@ -182,6 +182,14 @@ function _drupal_log_error($error, $fatal = FALSE) { drupal_add_http_header('Status', '500 Service unavailable (with message)'); } + if (drupal_is_cli()) { + if ($fatal) { + // When called from CLI, simply output a plain text message. + print html_entity_decode(strip_tags(t('%type: %message in %function (line %line of %file).', $error))). "\n"; + exit; + } + } + if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { if ($fatal) { // When called from JavaScript, simply output the error message. -- cgit v1.2.3