docs: correctly catch timeout errors, let real errors throw

This commit is contained in:
Brian Mann
2017-06-16 15:08:10 -04:00
parent 61a62d78a0
commit ae75db66ea

View File

@@ -76,9 +76,9 @@ function validateExternalUrl (href, source) {
err.message = `Request to: ${href} failed. (Status Code ${err.statusCode})`
throw err
})
.catch(errors.RequestError, (err) => {
console.log(`Request to: ${href} failed. Reason: ${err.message}`)
return
.catch({ code: 'ETIMEDOUT' }, () => {
/* eslint-disable no-console */
console.log(`Request to: ${href} timed out. Ignoring this error and proceeding.`)
})
}