build: do not excessively log response bodies

This commit is contained in:
Samuel Attard 2021-08-13 13:15:39 -07:00
parent 61117a11a1
commit fc9a197f6c
No known key found for this signature in database
GPG key ID: FB94249299E904FE

View file

@ -25,13 +25,13 @@ async function getAssetContents (repo, assetId) {
headers headers
}); });
if (!response.headers.location) { if (!response.headers.location) {
console.error(response.headers, response.body); console.error(response.headers, `${response.body}`.slice(0, 300));
throw new Error(`cannot find asset[${assetId}], asset download did not redirect`); throw new Error(`cannot find asset[${assetId}], asset download did not redirect`);
} }
const fileResponse = await got(response.headers.location); const fileResponse = await got(response.headers.location);
if (fileResponse.status !== 200) { if (fileResponse.status !== 200) {
console.error(fileResponse.headers, fileResponse.body); console.error(fileResponse.headers, `${fileResponse.body}`.slice(0, 300));
throw new Error(`cannot download asset[${assetId}] from ${response.headers.location}, got status: ${fileResponse.status}`); throw new Error(`cannot download asset[${assetId}] from ${response.headers.location}, got status: ${fileResponse.status}`);
} }