Skip to content

A platform for community discussion. Free, open, simple.

FIX: error reporting when adding a watched word

Neil Lalonde74834dddead5
diff --git a/app/assets/javascripts/admin/components/watched-word-form.js.es6 b/app/assets/javascripts/admin/components/watched-word-form.js.es6
index 1e187bcd538..9b2213de617 100644
--- a/app/assets/javascripts/admin/components/watched-word-form.js.es6
+++ b/app/assets/javascripts/admin/components/watched-word-form.js.es6
@@ -33,9 +33,9 @@ export default Ember.Component.extend({
Ember.run.schedule('afterRender', () => this.$('.watched-word-input').focus());
}).catch(e => {
this.set('formSubmitted', false);
- const msg = (e.responseJSON && e.responseJSON.errors) ?
- I18n.t("generic_error_with_reason", {error: e.responseJSON.errors.join('. ')}) :
- I18n.t("generic_error");
+ const msg = (e.jqXHR.responseJSON && e.jqXHR.responseJSON.errors) ?
+ I18n.t("generic_error_with_reason", {error: e.jqXHR.responseJSON.errors.join('. ')}) :
+ I18n.t("generic_error");
bootbox.alert(msg, () => this.$('.watched-word-input').focus());
});
}