1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-13 20:28:44 +01:00

Merge pull request #3545 from VSEphpbb/ticket/13771

[ticket/13771] Allow AJAX errors to support exceptions messages
This commit is contained in:
Marc Alexander 2015-05-30 11:33:48 +02:00
commit df4b391baa

View File

@ -262,8 +262,15 @@ phpbb.ajaxify = function(options) {
console.log('AJAX error. status: ' + textStatus + ', message: ' + errorThrown);
}
phpbb.clearLoadingTimeout();
var errorText = false;
if (typeof errorThrown === 'string' && errorThrown.length > 0) {
var responseText, errorText = false;
try {
responseText = JSON.parse(jqXHR.responseText);
responseText = responseText.message;
} catch (e) {}
if (typeof responseText === 'string' && responseText.length > 0) {
errorText = responseText;
}
else if (typeof errorThrown === 'string' && errorThrown.length > 0) {
errorText = errorThrown;
}
else {