diff --git a/lib/core.js b/lib/core.js index 697fd46fc..e54548399 100644 --- a/lib/core.js +++ b/lib/core.js @@ -1503,7 +1503,7 @@ var fetch_data = {...data}; if (!data.error && !data.status_code) { - console.warn('No error param in registerFetchError data'); + console.warn('No error param in registerFetchError data', data); } else if (data.error) { // Convert runtime `error` to `error_code` and `error_message`. if (typeof data.error === 'string') { diff --git a/lib/plugins/system/meta/cachedMeta.js b/lib/plugins/system/meta/cachedMeta.js index a842dda14..1a1497968 100644 --- a/lib/plugins/system/meta/cachedMeta.js +++ b/lib/plugins/system/meta/cachedMeta.js @@ -83,7 +83,9 @@ export default { } } - if (data.error.responseStatusCode !== 200) { + // Redirects don't have `responseStatusCode`. Only errors have status. + if (data.error.responseStatusCode + && data.error.responseStatusCode !== 200) { options.registerFetchError({ source: 'cache', url: url, @@ -96,7 +98,9 @@ export default { cb(data.error); } else if (data.htmlparser) { - if (data.htmlparser.__statusCode !== 200) { + // Wrong content types don't have `__statusCode`. Only errors have status. + if (data.htmlparser.__statusCode + && data.htmlparser.__statusCode !== 200) { options.registerFetchError({ source: 'cache', url: url,