From f55bfd876158660d2d67fab323f62549d4b0f832 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Fri, 3 Feb 2017 18:20:53 -0600 Subject: [PATCH] add error email whitelist --- gs/type/RefreshData.gs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gs/type/RefreshData.gs b/gs/type/RefreshData.gs index 2443a0bd9..b4a68f0e3 100644 --- a/gs/type/RefreshData.gs +++ b/gs/type/RefreshData.gs @@ -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 + "
" + err.message); + if (!(urlResponseWhitelist.indexOf(url) > -1)) { + MailApp.sendEmail(noticeEmailAddress, "Error: " + url, "Error: " + url + "
" + err.message); + } } } }