From 2b0337f68764de19ae9bd2435bb08f7908a5e094 Mon Sep 17 00:00:00 2001 From: Esteban Pastorino Date: Wed, 22 Nov 2023 17:33:56 -0300 Subject: [PATCH] fix: more error handling in metadata fetching to normalize errors --- .../src/plugins_core/blobs_upload/index.ts | 2 +- .../src/plugins_core/blobs_upload/utils.ts | 9 +++++++-- .../tests/blobs_upload/snapshots/tests.js.md | 2 +- .../tests/blobs_upload/snapshots/tests.js.snap | Bin 896 -> 903 bytes 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/build/src/plugins_core/blobs_upload/index.ts b/packages/build/src/plugins_core/blobs_upload/index.ts index 48d13cb335..97e377009f 100644 --- a/packages/build/src/plugins_core/blobs_upload/index.ts +++ b/packages/build/src/plugins_core/blobs_upload/index.ts @@ -38,7 +38,7 @@ const coreStep = async function ({ } catch (err) { logError(logs, `Error uploading blobs to deploy store: ${err.message}`) - const error = new Error(`Failed while uploading blobs to deploy store.`) + const error = new Error(`Failed while uploading blobs to deploy store`) addErrorInfo(error, { type: 'blobsUploadError' }) throw error } diff --git a/packages/build/src/plugins_core/blobs_upload/utils.ts b/packages/build/src/plugins_core/blobs_upload/utils.ts index 45a090a5a2..66fab7af38 100644 --- a/packages/build/src/plugins_core/blobs_upload/utils.ts +++ b/packages/build/src/plugins_core/blobs_upload/utils.ts @@ -60,7 +60,12 @@ async function readMetadata(metadataPath: string): PromiseSS&u82m|XnsK3_@ zbP1$nd>@Ml00000000B+n9Xj}KoG|Z6sUaT4d#Fp5Y%bt%?CsYtprpQl@^Ipw6-V7 z(#@{5yKb8s2p)k4pjFOOsNiZK8bHJD!aHGxHle2lY^>Xvcj1 zhL&4_`|GqF8b}kNSo{!TB}*1`Dq*jQ5@MwNZQwC*1Bq6bAbjpS#gb# zRl3cMWQl1iYd#*tF|+L5{Er)Rx98mB+ReE;*T2qtuh0r!Z^P4+ix^J(@P2>!aG{@` z_ZZ%yHe5*$;EBxDD2JIE6@STJau#cXH4LrC7^aN?tWGi8a@l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