Error responses from scraped pages should not return metadata (#2691)

* Don't return error pages as valid scrapes

* Fix linting

* whitespace
This commit is contained in:
Max Baumann
2019-11-08 19:57:20 +01:00
committed by Wyatt Johnson
parent f1a0febd6c
commit 0645735d2b
+6
View File
@@ -75,6 +75,12 @@ const scraper = {
});
const html = await res.text();
if (!res.ok) {
let err = new Error(res.statusText);
err.response = res;
throw err;
}
// Get the metadata from the scraped html.
const meta = await metascraper({
html,