aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/assets
diff options
context:
space:
mode:
authorVjacheslav Trushkin <cyberalien@gmail.com>2013-05-20 21:35:51 +0300
committerVjacheslav Trushkin <cyberalien@gmail.com>2013-05-20 21:35:51 +0300
commita9c9448ebbaaeef9c120bdf2eaf7360380eabe03 (patch)
treeda5f794ee332317897e8dc19ee6cd5922fb0a125 /phpBB/assets
parent778658f7876db462fdc37fdfa91c02ad0c4baea1 (diff)
downloadforums-a9c9448ebbaaeef9c120bdf2eaf7360380eabe03.tar
forums-a9c9448ebbaaeef9c120bdf2eaf7360380eabe03.tar.gz
forums-a9c9448ebbaaeef9c120bdf2eaf7360380eabe03.tar.bz2
forums-a9c9448ebbaaeef9c120bdf2eaf7360380eabe03.tar.xz
forums-a9c9448ebbaaeef9c120bdf2eaf7360380eabe03.zip
[ticket/11279] Clearer AJAX errors
Display clearer AJAX errors rather than generic error PHPBB3-11279
Diffstat (limited to 'phpBB/assets')
-rw-r--r--phpBB/assets/javascript/core.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index e3f1f9f55b..4b5b5258bc 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -252,9 +252,21 @@ phpbb.ajaxify = function(options) {
return;
}
- function errorHandler() {
+ /**
+ * Handler for AJAX errors
+ */
+ function errorHandler(jqXHR, textStatus, errorThrown) {
phpbb.clearLoadingTimeout();
- phpbb.alert(dark.attr('data-ajax-error-title'), dark.attr('data-ajax-error-text'));
+ var errorText = false;
+ if (typeof errorThrown === 'string' && errorThrown.length > 0) {
+ errorText = errorThrown;
+ }
+ else {
+ errorText = dark.attr('data-ajax-error-text-' + textStatus);
+ if (typeof errorText !== 'string' || !errorText.length)
+ errorText = dark.attr('data-ajax-error-text');
+ }
+ phpbb.alert(dark.attr('data-ajax-error-title'), errorText);
}
/**