diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-05-03 07:35:37 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-05-03 07:35:37 +0000 |
commit | ac5e86e05cf4647a9ecf37d6978fa04ed1b89e24 (patch) | |
tree | 5ab4624edcf915267c3cf8171b609521e3e3e72a /misc/drupal.js | |
parent | cdb326fc741b77ec2ba2699baec6f7770b6b02b1 (diff) | |
download | brdo-ac5e86e05cf4647a9ecf37d6978fa04ed1b89e24.tar.gz brdo-ac5e86e05cf4647a9ecf37d6978fa04ed1b89e24.tar.bz2 |
- Patch #329015 by Damien Tournoud: improved error handling of batch API.
Diffstat (limited to 'misc/drupal.js')
-rw-r--r-- | misc/drupal.js | 8 |
1 files changed, 4 insertions, 4 deletions
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, '<br />'); }; |