Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: log got error response bodies #40976

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion script/prepare-appveyor.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,14 @@ async function checkAppVeyorImage (options) {
const { cloudSettings } = settings;
return cloudSettings.images.find(image => image.name === `${options.imageVersion}`) || null;
} 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);
}
}
}

Expand Down
18 changes: 16 additions & 2 deletions script/release/ci-release-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,14 @@ async function circleCIRequest (url, method, requestBody) {
}

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);
}
});
}

Expand Down Expand Up @@ -234,7 +241,14 @@ async function callAppVeyor (targetBranch, job, options) {
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}`);
} 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);
}
}
}

Expand Down
9 changes: 8 additions & 1 deletion script/release/get-url-hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ module.exports = async function getUrlHash (targetUrl, algorithm = 'sha256', att
return resp.body.trim();
} catch (err) {
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);
}
throw err;
Expand Down