From 234c843e8a84324e60c3232a1b2e328870208388 Mon Sep 17 00:00:00 2001 From: branberry Date: Thu, 19 Oct 2023 10:24:32 -0500 Subject: [PATCH] [DOP-4033]: Add error handling for dependency helper --- .../src/helpers/dependency-helpers.ts | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/commands/src/helpers/dependency-helpers.ts b/src/commands/src/helpers/dependency-helpers.ts index c733d186a..fce60dbf1 100644 --- a/src/commands/src/helpers/dependency-helpers.ts +++ b/src/commands/src/helpers/dependency-helpers.ts @@ -47,14 +47,19 @@ export async function prepareBuildAndGetDependencies(repoName: string, projectNa createEnvProdFile(repoDir, projectName, baseUrl), ]; - const dependencies = await Promise.all(commandPromises); - - return { - commitHash: dependencies[0] as string, - commitBranch: dependencies[1] as string, - patchId: dependencies[2] as string | undefined, - hasRedirects: dependencies[3] as boolean, - bundlePath: `${repoDir}/bundle.zip`, - repoDir, - }; + try { + const dependencies = await Promise.all(commandPromises); + + return { + commitHash: dependencies[0] as string, + commitBranch: dependencies[1] as string, + patchId: dependencies[2] as string | undefined, + hasRedirects: dependencies[3] as boolean, + bundlePath: `${repoDir}/bundle.zip`, + repoDir, + }; + } catch (error) { + console.error('ERROR! Could not get build dependencies'); + throw error; + } }