mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
add email notifications on error
This commit is contained in:
parent
17b0c0e7cc
commit
ac797132ae
1 changed files with 6 additions and 1 deletions
|
|
@ -436,9 +436,14 @@ function refreshHttpResponses(triggerNum) {
|
|||
var url = rangeData.getCell(i - 1, 1).getValue();
|
||||
if (url) {
|
||||
try {
|
||||
rangeStatus.setValue(UrlFetchApp.fetch(url).getResponseCode());
|
||||
var urlStatus = UrlFetchApp.fetch(url).getResponseCode();
|
||||
rangeStatus.setValue(urlStatus);
|
||||
if (urlStatus != 200) {
|
||||
MailApp.sendEmail("cb+flnotice" + "@collinmbarrett.com", urlStatus + ": " + url, urlStatus + ": " + url);
|
||||
}
|
||||
} catch (err) {
|
||||
rangeStatus.setValue(err.message);
|
||||
MailApp.sendEmail("cb+flnotice" + "@collinmbarrett.com", "Error: " + url, "Error: " + url + "<br>" + err.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue