build: log got error response bodies (#40965)
This commit is contained in:
parent
bbfe809d02
commit
57b29903e3
3 changed files with 32 additions and 4 deletions
|
@ -70,7 +70,14 @@ async function checkAppVeyorImage (options) {
|
||||||
const { cloudSettings } = settings;
|
const { cloudSettings } = settings;
|
||||||
return cloudSettings.images.find(image => image.name === `${options.imageVersion}`) || null;
|
return cloudSettings.images.find(image => image.name === `${options.imageVersion}`) || null;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('Could not call AppVeyor: ', err);
|
if (err.response?.body) {
|
||||||
|
console.error('Could not call AppVeyor: ', {
|
||||||
|
statusCode: err.response.statusCode,
|
||||||
|
body: JSON.parse(err.response.body)
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.error('Error calling AppVeyor:', err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,14 @@ async function circleCIRequest (url, method, requestBody) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return makeRequest(requestOpts, true).catch(err => {
|
return makeRequest(requestOpts, true).catch(err => {
|
||||||
console.log('Error calling CircleCI:', err);
|
if (err.response?.body) {
|
||||||
|
console.error('Could not call CircleCI: ', {
|
||||||
|
statusCode: err.response.statusCode,
|
||||||
|
body: JSON.parse(err.response.body)
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.error('Error calling CircleCI:', err);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,7 +241,14 @@ async function callAppVeyor (targetBranch, job, options) {
|
||||||
const buildUrl = `https://ci.appveyor.com/project/electron-bot/${appVeyorJobs[job]}/build/${version}`;
|
const buildUrl = `https://ci.appveyor.com/project/electron-bot/${appVeyorJobs[job]}/build/${version}`;
|
||||||
console.log(`AppVeyor release build request for ${job} successful. Check build status at ${buildUrl}`);
|
console.log(`AppVeyor release build request for ${job} successful. Check build status at ${buildUrl}`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('Could not call AppVeyor: ', err);
|
if (err.response?.body) {
|
||||||
|
console.error('Could not call AppVeyor: ', {
|
||||||
|
statusCode: err.response.statusCode,
|
||||||
|
body: JSON.parse(err.response.body)
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.error('Error calling AppVeyor:', err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,14 @@ module.exports = async function getUrlHash (targetUrl, algorithm = 'sha256', att
|
||||||
return resp.body.trim();
|
return resp.body.trim();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (attempts > 1) {
|
if (attempts > 1) {
|
||||||
console.error('Failed to get URL hash for', targetUrl, 'we will retry', err);
|
if (err.response?.body) {
|
||||||
|
console.error(`Failed to get URL hash for ${targetUrl} - we will retry`, {
|
||||||
|
statusCode: err.response.statusCode,
|
||||||
|
body: JSON.parse(err.response.body)
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.error(`Failed to get URL hash for ${targetUrl} - we will retry`, err);
|
||||||
|
}
|
||||||
return getUrlHash(targetUrl, algorithm, attempts - 1);
|
return getUrlHash(targetUrl, algorithm, attempts - 1);
|
||||||
}
|
}
|
||||||
throw err;
|
throw err;
|
||||||
|
|
Loading…
Reference in a new issue