diff options
author | Matt Friedman <maf675@gmail.com> | 2015-04-21 00:19:41 -0700 |
---|---|---|
committer | Matt Friedman <maf675@gmail.com> | 2015-04-21 00:19:41 -0700 |
commit | 4a7f905c6aaa93b4c7160e9c99fced3001189037 (patch) | |
tree | 2a56430996ff2239aa7abf8add2fd2f7c99069df /phpBB/assets/javascript | |
parent | c46024bfa20a4dbd39538bb4a55fe5f579bc40cf (diff) | |
download | forums-4a7f905c6aaa93b4c7160e9c99fced3001189037.tar forums-4a7f905c6aaa93b4c7160e9c99fced3001189037.tar.gz forums-4a7f905c6aaa93b4c7160e9c99fced3001189037.tar.bz2 forums-4a7f905c6aaa93b4c7160e9c99fced3001189037.tar.xz forums-4a7f905c6aaa93b4c7160e9c99fced3001189037.zip |
[ticket/13771] Allow AJAX errors to support exceptions messages
PHPBB3-13771
Diffstat (limited to 'phpBB/assets/javascript')
-rw-r--r-- | phpBB/assets/javascript/core.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 806db7d35f..33f4021cb9 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -263,7 +263,11 @@ phpbb.ajaxify = function(options) { } phpbb.clearLoadingTimeout(); var errorText = false; - if (typeof errorThrown === 'string' && errorThrown.length > 0) { + var responseText = $.parseJSON(jqXHR.responseText); + if (typeof responseText.message === 'string' && responseText.message.length > 0) { + errorText = responseText.message; + } + else if (typeof errorThrown === 'string' && errorThrown.length > 0) { errorText = errorThrown; } else { |