Hello,
I have a script that checks my client's final URLs and their status codes - (201,301,404 and so on).
The problem that I have run into is when there is an SSL Error.
I want to know about that but SSL Errors seem to cause errors in the code itself.
Instead of continuing on with the running of the code, it breaks the code which in turn stops checking other URLs.
The last thing I want to do is set "validateHttpsCertificates: false" because I would want to know if there is an SSL issue.
This is the code that I am using:
function getUrlStatus(url) {
var response = UrlFetchApp.fetch(url, { muteHttpExceptions: true, validateHttpsCertificates: true});
if (response.getResponseCode()!== 200){
Logger.log("URL Error: %s \n %s",response.getResponseCode(), response);
}
return response.getResponseCode();
}
How would I keep the code running instead of breaking on these types of SSL errors?
Thanks and I look forward to your reply.