build: improve logging on http errors during release process (#43760)
* build: improve logging on http errors during release process (#43756) Co-authored-by: Samuel Attard <sam@electronjs.org> * build: improve logging on http errors during release process (again) (#43757) Co-authored-by: Samuel Attard <sam@electronjs.org> * build: improve logging on http errors during release process (again, but more) (#43758) Co-authored-by: Samuel Attard <sam@electronjs.org> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <sam@electronjs.org>
This commit is contained in:
parent
c5e1a336f2
commit
d519913bfa
3 changed files with 37 additions and 7 deletions
|
@ -15,8 +15,13 @@ module.exports = async function getUrlHash (targetUrl, algorithm = 'sha256', att
|
|||
search: search.toString()
|
||||
});
|
||||
try {
|
||||
const resp = await got(functionUrl);
|
||||
if (resp.statusCode !== 200) throw new Error('non-200 status code received from hasher function');
|
||||
const resp = await got(functionUrl, {
|
||||
throwHttpErrors: false
|
||||
});
|
||||
if (resp.statusCode !== 200) {
|
||||
console.error('bad hasher function response:', resp.body.trim());
|
||||
throw new Error('non-200 status code received from hasher function');
|
||||
}
|
||||
if (!resp.body) throw new Error('Successful lambda call but failed to get valid hash');
|
||||
|
||||
return resp.body.trim();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue