fix mail settings save failure message construction

This commit is contained in:
ayan4m1 2018-09-16 12:13:59 -04:00
parent c8ac013b65
commit 006832de21
1 changed files with 4 additions and 2 deletions

View File

@ -158,14 +158,16 @@
function showErrorDialog(jqXHR, verb) { function showErrorDialog(jqXHR, verb) {
console.error(jqXHR); console.error(jqXHR);
var errorText; var errorText = '';
if (!jqXHR.responseJSON) { if (!jqXHR.responseJSON) {
errorText = jqXHR.responseText; errorText = jqXHR.responseText;
} else if (jqXHR.responseJSON.error) { } else if (jqXHR.responseJSON.error) {
errorText = jqXHR.responseJSON.error; errorText = jqXHR.responseJSON.error;
} else if (jqXHR.responseJSON.errors) { } else if (jqXHR.responseJSON.errors) {
$.each(jqXHR.responseJSON.errors, function (i, v) { $.each(jqXHR.responseJSON.errors, function (i, v) {
errorText += ', ' + v.detail; if (v.detail) {
errorText += v.detail + ' ';
}
}); });
} }