summaryrefslogtreecommitdiff
path: root/includes/errors.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-04-08 18:11:27 +0000
committerDries Buytaert <dries@buytaert.net>2010-04-08 18:11:27 +0000
commita71b70f069bba49477b49a3da1e7f81d3d2f0a75 (patch)
treeb2985ce142ce110480602d3361d0749629a0132d /includes/errors.inc
parente8cfe921116e5e1c6e2a7e5081079bb052d7af63 (diff)
downloadbrdo-a71b70f069bba49477b49a3da1e7f81d3d2f0a75.tar.gz
brdo-a71b70f069bba49477b49a3da1e7f81d3d2f0a75.tar.bz2
- Patch #705242 by moshe weitzman: _drupal_log_error() messy for CLI requests.
Diffstat (limited to 'includes/errors.inc')
-rw-r--r--includes/errors.inc8
1 files changed, 8 insertions, 0 deletions
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.