From ac5e86e05cf4647a9ecf37d6978fa04ed1b89e24 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 3 May 2009 07:35:37 +0000 Subject: - Patch #329015 by Damien Tournoud: improved error handling of batch API. --- misc/drupal.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'misc') diff --git a/misc/drupal.js b/misc/drupal.js index cb650ac65..e71adda75 100644 --- a/misc/drupal.js +++ b/misc/drupal.js @@ -296,16 +296,16 @@ Drupal.getSelection = function (element) { * Build an error message from ahah response. */ Drupal.ahahError = function (xmlhttp, uri) { - if (xmlhttp.status == 200) { + if (xmlhttp.status == 200 || (xmlhttp.status == 500 && xmlhttp.statusText == 'Service unavailable (with message)')) { if ($.trim(xmlhttp.responseText)) { - var message = Drupal.t('An error occurred. \n@uri\n@text', { '@uri': uri, '@text': xmlhttp.responseText }); + var message = Drupal.t("An error occurred. \nPath: @uri\nMessage: !text", { '@uri': uri, '!text': xmlhttp.responseText }); } else { - var message = Drupal.t('An error occurred. \n@uri\n(no information available).', { '@uri': uri }); + var message = Drupal.t("An error occurred. \nPath: @uri\n(no information available).", {'@uri': uri }); } } else { - var message = Drupal.t('An HTTP error @status occurred. \n@uri', { '@uri': uri, '@status': xmlhttp.status }); + var message = Drupal.t("An HTTP error @status occurred. \nPath: @uri", { '@uri': uri, '@status': xmlhttp.status }); } return message.replace(/\n/g, '
'); }; -- cgit v1.2.3