1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-28 12:30:42 +02:00

[ticket/11279] Clearer AJAX errors

Display clearer AJAX errors rather than generic error

PHPBB3-11279
This commit is contained in:
Vjacheslav Trushkin
2013-05-20 21:35:51 +03:00
parent 778658f787
commit a9c9448ebb
4 changed files with 19 additions and 4 deletions

View File

@@ -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);
}
/**