mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00: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
1 changed files with 9 additions and 2 deletions
|
@ -262,8 +262,15 @@ phpbb.ajaxify = function(options) {
|
||||||
console.log('AJAX error. status: ' + textStatus + ', message: ' + errorThrown);
|
console.log('AJAX error. status: ' + textStatus + ', message: ' + errorThrown);
|
||||||
}
|
}
|
||||||
phpbb.clearLoadingTimeout();
|
phpbb.clearLoadingTimeout();
|
||||||
var errorText = false;
|
var responseText, errorText = false;
|
||||||
if (typeof errorThrown === 'string' && errorThrown.length > 0) {
|
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;
|
errorText = errorThrown;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue