FIX: error reporting when adding a watched word

This commit is contained in:
Neil Lalonde 2018-04-24 14:25:00 -04:00
parent 02590feb4d
commit 74834dddea
1 changed files with 3 additions and 3 deletions

View File

@ -33,8 +33,8 @@ export default Ember.Component.extend({
Ember.run.schedule('afterRender', () => this.$('.watched-word-input').focus()); Ember.run.schedule('afterRender', () => this.$('.watched-word-input').focus());
}).catch(e => { }).catch(e => {
this.set('formSubmitted', false); this.set('formSubmitted', false);
const msg = (e.responseJSON && e.responseJSON.errors) ? const msg = (e.jqXHR.responseJSON && e.jqXHR.responseJSON.errors) ?
I18n.t("generic_error_with_reason", {error: e.responseJSON.errors.join('. ')}) : I18n.t("generic_error_with_reason", {error: e.jqXHR.responseJSON.errors.join('. ')}) :
I18n.t("generic_error"); I18n.t("generic_error");
bootbox.alert(msg, () => this.$('.watched-word-input').focus()); bootbox.alert(msg, () => this.$('.watched-word-input').focus());
}); });