Skip to content
Snippets Groups Projects
Commit 23931871 authored by svornost's avatar svornost
Browse files

Catch exceptions thrown by rules assistant instead of letting them eat the...

Catch exceptions thrown by rules assistant instead of letting them eat the entire slave assignment report
parent 89ff5778
No related branches found
No related tags found
No related merge requests found
......@@ -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];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment