handle cases where single text exception message is returned

This commit is contained in:
ayan4m1 2018-09-15 23:15:12 -04:00
parent 3a45bc1986
commit 7db14bed8b

View file

@ -159,7 +159,9 @@
function showErrorDialog(jqXHR, verb) { function showErrorDialog(jqXHR, verb) {
console.error(jqXHR); console.error(jqXHR);
var errorText; var errorText;
if (jqXHR.responseJSON.error) { if (!jqXHR.responseJSON) {
errorText = jqXHR.responseText;
} 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) {