summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc7
1 files changed, 7 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 39796bbd4..5285e7311 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -1183,6 +1183,13 @@ function _drupal_log_error($error, $fatal = FALSE) {
drupal_add_http_header('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.