From 18fa97c8db2c643106d3b3c4c8bf00f9e20bdfb5 Mon Sep 17 00:00:00 2001 From: kollivier Date: Tue, 21 Aug 2018 12:50:47 -0700 Subject: [PATCH] Have Sentry report channel load failures in order to help us track down the cause of issue #900. --- .../js/edit_channel/new_channel/views.js | 36 ++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/contentcuration/contentcuration/static/js/edit_channel/new_channel/views.js b/contentcuration/contentcuration/static/js/edit_channel/new_channel/views.js index 76b8cc5987..2f87436691 100644 --- a/contentcuration/contentcuration/static/js/edit_channel/new_channel/views.js +++ b/contentcuration/contentcuration/static/js/edit_channel/new_channel/views.js @@ -72,28 +72,56 @@ var ChannelListPage = BaseViews.BaseView.extend({ el: self.$("#channel_list"), collection: channels }); - }); + }).catch(function(e) { + if (Raven && Raven.catchException) { + Raven.catchException(e); + } else { + console.log("Error retrieving current channel list:"); + console.log(e.statusText); + } + }); window.current_user.get_bookmarked_channels().then(function(channels){ self.starred_channel_list = new StarredChannelList({ container: self, el: self.$("#starred_list"), collection: channels }); - }); + }).catch(function(e) { + if (Raven && Raven.catchException) { + Raven.catchException(e); + } else { + console.log("Error retrieving bookmarked channel list:"); + console.log(e.statusText); + } + }); window.current_user.get_public_channels().then(function(channels){ self.public_channel_list = new PublicChannelList({ container: self, el: self.$("#public_list"), collection: channels }); - }); + }).catch(function(e) { + if (Raven && Raven.catchException) { + Raven.catchException(e); + } else { + console.log("Error retrieving public channel list:"); + console.log(e.statusText); + } + }); window.current_user.get_view_only_channels().then(function(channels){ self.viewonly_channel_list = new ViewOnlyChannelList({ container: self, el: self.$("#viewonly_list"), collection: channels }); - }); + }).catch(function(e) { + if (Raven && Raven.catchException) { + Raven.catchException(e); + } else { + console.log("Error retrieving view-only channel list:"); + console.log(e.statusText); + } + }); }, events: { 'click .new_channel_button' : 'new_channel',