Importer: Fix error handling

This commit is contained in:
Adrian Moennich 2017-10-05 12:05:23 +02:00
parent ce3e060f8e
commit 397a8685c9

View File

@ -105,9 +105,14 @@
onSuccess(data, textStatus);
}
},
error: function(jqxhr, textStatus, errorThrown) {
error: function(xhr) {
if ($.isFunction(onError)) {
onError(textStatus + ': ' + errorThrown);
onError({
title: $t.gettext('Something went wrong'),
message: '{0} ({1})'.format(xhr.statusText.toLowerCase(), xhr.status),
suggest_login: false,
report_url: null
});
}
}
});
@ -611,7 +616,7 @@
var errorCallback = function(error) {
if (error) {
hasError = true;
IndicoUI.Dialogs.Util.error(error);
showErrorDialog(error);
}
};
var date = self.destination.startDate.date.replace(/-/g, '/');