Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 16586)
+++ wp-includes/functions.php	(working copy)
@@ -2660,6 +2660,9 @@
 	if ( function_exists( 'apply_filters' ) ) {
 		$function = apply_filters( 'wp_die_handler', '_default_wp_die_handler');
 	}else {
+            if(defined('DOING_AJAX') && DOING_AJAX)
+                $function = '_ajax_wp_die_handler';            
+            else
 		$function = '_default_wp_die_handler';
 	}
 
@@ -2758,7 +2761,53 @@
 	die();
 }
 
+function _ajax_die_handler_filter() { 
+    return '_ajax_wp_die_handler'; 
+}
+
 /**
+ * Kill WordPress execution and send AJAX response with error message.
+ *
+ * This is AJAX-version of the default handler for wp_die
+ *
+ * @since 3.0.0
+ * @access private
+ *
+ * @param string $message Error message.
+ * @param string $title Error title.
+ * @param string|array $args Optional arguements to control behaviour.
+ */
+function _ajax_wp_die_handler( $message, $title = '', $args = array() ) {    
+	$defaults = array( 'response' => 200 );
+	$r = wp_parse_args($args, $defaults);	      	
+        if ( !headers_sent() ) {
+            status_header( $r['response'] );
+        }
+        if ( function_exists( 'is_wp_error' ) && is_wp_error( $message ) ) {
+		if ( empty( $title ) ) {
+			$error_data = $message->get_error_data();
+			if ( is_array( $error_data ) && isset( $error_data['title'] ) )
+				$title = $error_data['title'];
+		}
+		$errors = $message->get_error_messages();
+		switch ( count( $errors ) ) :
+		case 0 :
+			$message = '';
+			break;
+		case 1 :
+			$message = "<p>{$errors[0]}</p>";
+			break;
+		default :
+			$message = "<ul>\n\t\t<li>" . join( "</li>\n\t\t<li>", $errors ) . "</li>\n\t</ul>";
+			break;
+		endswitch;
+	} elseif ( is_string( $message ) ) {
+		$message = "<p>$message</p>";
+	}        
+        echo "<div style='text-align:left;'>" . $message . "</div>";    
+        die;
+}
+/**
  * Retrieve the WordPress home page URL.
  *
  * If the constant named 'WP_HOME' exists, then it willl be used and returned by
Index: wp-admin/admin-ajax.php
===================================================================
--- wp-admin/admin-ajax.php	(revision 16586)
+++ wp-admin/admin-ajax.php	(working copy)
@@ -21,6 +21,7 @@
 
 require_once('./includes/admin.php');
 @header('Content-Type: text/html; charset=' . get_option('blog_charset'));
+add_filter('wp_die_handler','_ajax_die_handler_filter');
 send_nosniff_header();
 
 do_action('admin_init');
