diff options
Diffstat (limited to 'phpBB/assets')
-rw-r--r-- | phpBB/assets/javascript/core.js | 16 |
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); } /** |