From 4e9cb210ffc7b80ad263143cb33dad3d36caf621 Mon Sep 17 00:00:00 2001
From: apotek <apotek@80531.no-reply.drupal.org>
Date: Tue, 5 Jun 2012 20:23:59 -0400
Subject: [PATCH] Issue #1587858: Fixed Ajax errors not respecting error_level setting.

---
 includes/errors.inc |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/includes/errors.inc b/includes/errors.inc
index f62bf06..9d0df05 100644
--- a/includes/errors.inc
+++ b/includes/errors.inc
@@ -230,8 +230,10 @@ function _drupal_log_error($error, $fatal = FALSE) {
 
   if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
     if ($fatal) {
-      // When called from JavaScript, simply output the error message.
-      print t('%type: !message in %function (line %line of %file).', $error);
+      if (error_displayable($error)) {
+        // When called from JavaScript, simply output the error message.
+        print t('%type: !message in %function (line %line of %file).', $error);
+      }
       exit;
     }
   }
-- 
1.7.0.2

