mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
add error email whitelist
This commit is contained in:
parent
7f27d46d8f
commit
f55bfd8761
1 changed files with 8 additions and 2 deletions
|
|
@ -14,6 +14,8 @@ var typeGitHubUrl = {
|
|||
"FilterLists Stale": "https://raw.githubusercontent.com/collinbarrett/FilterLists/master/json-data/stale.json"
|
||||
};
|
||||
|
||||
var urlResponseWhitelist = ["https://www.jabcreations.com/web/adblock-subscription"]
|
||||
|
||||
var ss = SpreadsheetApp.getActiveSpreadsheet(),
|
||||
options = [{
|
||||
name: "Refresh Data",
|
||||
|
|
@ -443,11 +445,15 @@ function refreshHttpResponses(triggerNum) {
|
|||
var urlStatus = UrlFetchApp.fetch(url).getResponseCode();
|
||||
rangeStatus.setValue(urlStatus);
|
||||
if (urlStatus != 200) {
|
||||
MailApp.sendEmail(noticeEmailAddress, urlStatus + ": " + url, urlStatus + ": " + url);
|
||||
if (!(urlResponseWhitelist.indexOf(url) > -1)) {
|
||||
MailApp.sendEmail(noticeEmailAddress, urlStatus + ": " + url, urlStatus + ": " + url);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
rangeStatus.setValue(err.message);
|
||||
MailApp.sendEmail(noticeEmailAddress, "Error: " + url, "Error: " + url + "<br>" + err.message);
|
||||
if (!(urlResponseWhitelist.indexOf(url) > -1)) {
|
||||
MailApp.sendEmail(noticeEmailAddress, "Error: " + url, "Error: " + url + "<br>" + err.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue