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:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user