Add logging full URL

This commit is contained in:
Adam Dobrawy 2021-01-05 04:46:06 +01:00 committed by GitHub
parent 13c185d93e
commit 821c9b7de9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,7 @@ const get = (url, options = {}) => new Promise((resolve, reject) => https
const body = Buffer.concat(chunks).toString('utf-8');
if (res.statusCode < 200 || res.statusCode > 300) {
return reject(Object.assign(
new Error(`Invalid status code: ${res.statusCode}`),
new Error(`Invalid status code '${res.statusCode}' for url '${url}'`),
{ res, body }
));
}