Catch unhandled exceptions

Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/77
This commit is contained in:
Raymond Hill 2023-10-05 11:25:28 -04:00
parent 6b211f622c
commit bd71d131a8
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 12 additions and 4 deletions

View File

@ -185,7 +185,9 @@ async function updateRegexRules() {
ubolLog(`Add ${addRules.length} DNR regex rules`);
}
return dnr.updateDynamicRules({ addRules, removeRuleIds });
return dnr.updateDynamicRules({ addRules, removeRuleIds }).catch(reason => {
console.error(`updateRegexRules() / ${reason}`);
});
}
/******************************************************************************/
@ -259,7 +261,9 @@ async function updateRemoveparamRules() {
ubolLog(`Add ${addRules.length} DNR removeparam rules`);
}
return dnr.updateDynamicRules({ addRules, removeRuleIds });
return dnr.updateDynamicRules({ addRules, removeRuleIds }).catch(reason => {
console.error(`updateRemoveparamRules() / ${reason}`);
});
}
/******************************************************************************/
@ -333,7 +337,9 @@ async function updateRedirectRules() {
ubolLog(`Add ${addRules.length} DNR redirect rules`);
}
return dnr.updateDynamicRules({ addRules, removeRuleIds });
return dnr.updateDynamicRules({ addRules, removeRuleIds }).catch(reason => {
console.error(`updateRedirectRules() / ${reason}`);
});
}
/******************************************************************************/
@ -407,7 +413,9 @@ async function updateModifyHeadersRules() {
ubolLog(`Add ${addRules.length} DNR modifyHeaders rules`);
}
return dnr.updateDynamicRules({ addRules, removeRuleIds });
return dnr.updateDynamicRules({ addRules, removeRuleIds }).catch(reason => {
console.error(`updateModifyHeadersRules() / ${reason}`);
});
}
/******************************************************************************/