diff options
Diffstat (limited to 'includes/errors.inc')
-rw-r--r-- | includes/errors.inc | 8 |
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. |