DEV: catch ajax error to show error message (#59)

DEV: catch ajax error to show error message (#59)

diff --git a/assets/javascripts/discourse/routes/admin-plugins-patreon.js.es6 b/assets/javascripts/discourse/routes/admin-plugins-patreon.js.es6
index 6e276c7..e3c2e25 100644
--- a/assets/javascripts/discourse/routes/admin-plugins-patreon.js.es6
+++ b/assets/javascripts/discourse/routes/admin-plugins-patreon.js.es6
@@ -1,3 +1,4 @@
+import { popupAjaxError } from "discourse/lib/ajax-error";
 import Group from "discourse/models/group";
 import { ajax } from "discourse/lib/ajax";
 import FilterRule from "discourse/plugins/discourse-patreon/discourse/models/filter-rule";
@@ -12,18 +13,20 @@ export default DiscourseRoute.extend({
     return Ember.RSVP.Promise.all([
       ajax("/patreon/list.json"),
       Group.findAll({ ignore_automatic: true }),
-    ]).then(([result, groups]) => {
-      groups = groups.map((g) => {
-        return { id: g.id, name: g.name };
-      });
+    ])
+      .then(([result, groups]) => {
+        groups = groups.map((g) => {
+          return { id: g.id, name: g.name };
+        });
 
-      return {
-        filters: result.filters,
-        rewards: result.rewards,
-        last_sync_at: result.last_sync_at,
-        groups: groups,
-      };
-    });
+        return {
+          filters: result.filters,
+          rewards: result.rewards,
+          last_sync_at: result.last_sync_at,
+          groups: groups,
+        };
+      })
+      .catch(popupAjaxError);
   },
 
   setupController: function (controller, model) {

GitHub sha: e8195e0a

This commit appears in #59 which was approved by CvX. It was merged by jjaffeux.