Log only HTTP errors (#2702)

This commit is contained in:
Peter Hedenskog 2019-10-17 08:36:41 +02:00 committed by GitHub
parent b55f1e4d44
commit 1ca9d563b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -82,11 +82,13 @@ module.exports = {
for (let summary of pageSummary) {
if (Object.keys(summary.responseCodes).some(code => code > 399)) {
for (let asset of summary.assets) {
log.info(
`Error: The server responded with a ${
asset.status
} status code for ${asset.url}`
);
if (asset.status > 399) {
log.info(
`The server responded with a ${
asset.status
} status code for ${asset.url}`
);
}
}
}
}