diff --git a/src/endWeek/rulesAssistantReport.js b/src/endWeek/rulesAssistantReport.js index e64a32c4dcf3092f38e74c5cd5b728257f585cf8..f87b0924bcb2c4e005fa3554328a47e1aa55b38b 100644 --- a/src/endWeek/rulesAssistantReport.js +++ b/src/endWeek/rulesAssistantReport.js @@ -2,7 +2,12 @@ App.EndWeek.rulesAssistantReport = function() { const frag = $(document.createDocumentFragment()); for (const slave of V.slaves) { if (slave.useRulesAssistant === 1) { - frag.append(DefaultRules(slave)); + try { + frag.append(DefaultRules(slave)); + } catch (e) { + console.log("Exception thrown in rule evaluation:", slave, e); + frag.append(`<p><span class="error">Exception thrown executing Rules Assistant for ${SlaveFullName(slave)}: "${e.message}". One of your rules is probably broken.</span></p>`); + } } } return frag[0];