Only pass error to showErrorMessage

This commit is contained in:
Kshitij Sobti
2018-06-13 14:59:06 +05:30
parent b31b311294
commit e2b7d289a8
2 changed files with 3 additions and 7 deletions

View File

@@ -72,7 +72,7 @@
});
dispatcher.listenTo(search, 'error', function() {
form.showErrorMessage(search);
form.showErrorMessage(search.errorMessage);
form.hideLoadingIndicator();
});

View File

@@ -60,12 +60,8 @@
this.clearSearch();
},
showErrorMessage: function(search) {
if (search && search.errorMessage) {
this.$message.text(gettext(search.errorMessage));
} else {
this.$message.text(gettext('There was an error, try searching again.'));
}
showErrorMessage: function (error) {
this.$message.text(gettext(error || 'There was an error, try searching again.'));
}
});