From b3223694fd59874a389b324f1a2334f088d4b375 Mon Sep 17 00:00:00 2001 From: dorey Date: Thu, 4 Jun 2020 17:55:39 -0400 Subject: [PATCH] get a better error message from Raven Towards #2450 --- jsapp/xlform/src/view.surveyApp.coffee | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/jsapp/xlform/src/view.surveyApp.coffee b/jsapp/xlform/src/view.surveyApp.coffee index 9df4532499..ead620d790 100644 --- a/jsapp/xlform/src/view.surveyApp.coffee +++ b/jsapp/xlform/src/view.surveyApp.coffee @@ -19,6 +19,9 @@ module.exports = do -> _notifyIfRowsOutOfOrder = do -> # a temporary function to notify devs if rows are mysteriously falling out of order fn = (surveyApp)-> + if surveyApp.orderfail + # it's already been reported so no need to report it again + return survey = surveyApp.survey elIds = [] surveyApp.$('.survey__row').each -> elIds.push $(@).data('rowId') @@ -30,9 +33,13 @@ module.exports = do -> _s = (i)-> JSON.stringify(i) if _s(rIds) isnt _s(elIds) - Raven?.captureException new Error('Row model does not match view'), extra: - rIds: _s(rIds) - elIds: _s(elIds) + pathname = window.location.pathname + surveyApp.orderfail = true + err_message = """ + Row model does not match view: #{_s(rIds)} #{_s(elIds)} #{pathname} + """.trim() + console?.error(err_message) + Raven?.captureException new Error(err_message) false else