mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-14 04:30:29 +01:00
Merge pull request #3545 from VSEphpbb/ticket/13771
[ticket/13771] Allow AJAX errors to support exceptions messages
This commit is contained in:
commit
df4b391baa
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user