build: update hasher return value (#47012)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
This commit is contained in:
parent
07c0357366
commit
f5bb2f480d
1 changed files with 3 additions and 1 deletions
|
@ -28,7 +28,9 @@ export async function getUrlHash (targetUrl: string, algorithm = 'sha256', attem
|
||||||
}
|
}
|
||||||
if (!resp.body) throw new Error('Successful lambda call but failed to get valid hash');
|
if (!resp.body) throw new Error('Successful lambda call but failed to get valid hash');
|
||||||
|
|
||||||
return resp.body.trim();
|
// response shape should be { hash: 'xyz', invocationId: "abc"}
|
||||||
|
const { hash } = JSON.parse(resp.body.trim());
|
||||||
|
return hash;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (attempts > 1) {
|
if (attempts > 1) {
|
||||||
const { response } = err as any;
|
const { response } = err as any;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue